]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix uninitalized value in encode_coding_object
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 28 Jul 2015 06:18:14 +0000 (23:18 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 28 Jul 2015 06:40:27 +0000 (23:40 -0700)
* src/coding.c (encode_coding_object): Also initialize
coding->src_pos and coding->src_pos_byte when NILP (src_object).
This avoids later use of uninitialized storage.

src/coding.c

index 9d1ebc8a4cb20be14cb6fec3bf7c88731818df90..1887560827cfac5c81b1cbb678ea5c97849e1059 100644 (file)
@@ -8301,7 +8301,11 @@ encode_coding_object (struct coding_system *coding,
        }
     }
   else
-    code_conversion_save (0, 0);
+    {
+      code_conversion_save (0, 0);
+      coding->src_pos = from;
+      coding->src_pos_byte = from_byte;
+    }
 
   if (BUFFERP (dst_object))
     {