diff options
| author | Paul Eggert | 2015-07-27 23:18:14 -0700 |
|---|---|---|
| committer | Paul Eggert | 2015-07-27 23:40:27 -0700 |
| commit | f5dc3cf21cf6d6f51c096262225fcb96a8a7f126 (patch) | |
| tree | 21f6874e597cc75b5bf881dbf538ed2dc223cbbd /src/coding.c | |
| parent | bb8ec488fc2d53ea0dd2a517b78d40457fb5368f (diff) | |
| download | emacs-f5dc3cf21cf6d6f51c096262225fcb96a8a7f126.tar.gz emacs-f5dc3cf21cf6d6f51c096262225fcb96a8a7f126.zip | |
Fix uninitalized value in encode_coding_object
* 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.
Diffstat (limited to 'src/coding.c')
| -rw-r--r-- | src/coding.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/coding.c b/src/coding.c index 9d1ebc8a4cb..1887560827c 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -8301,7 +8301,11 @@ encode_coding_object (struct coding_system *coding, | |||
| 8301 | } | 8301 | } |
| 8302 | } | 8302 | } |
| 8303 | else | 8303 | else |
| 8304 | code_conversion_save (0, 0); | 8304 | { |
| 8305 | code_conversion_save (0, 0); | ||
| 8306 | coding->src_pos = from; | ||
| 8307 | coding->src_pos_byte = from_byte; | ||
| 8308 | } | ||
| 8305 | 8309 | ||
| 8306 | if (BUFFERP (dst_object)) | 8310 | if (BUFFERP (dst_object)) |
| 8307 | { | 8311 | { |