summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2014-01-25 16:32:30 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2014-01-25 16:32:30 -0800
commit4f8c23b12913774c1a6cec56eb2bc60b17026af3 (patch)
treecfb5eee9b8d60660b70852a80b2b4d5097af21be
parented85dee69d1ba238407326f67b0a25eaa3ddaab7 (diff)
downloademacs-4f8c23b12913774c1a6cec56eb2bc60b17026af3.tar.gz
Fix crash with insert-file-contents and misdecoded text.
* fileio.c (Finsert_file_contents): Set CODING_MODE_LAST_BLOCK before invoking decode_coding_gap, since there's just one block. Fixes: debbugs:16286
-rw-r--r--src/ChangeLog6
-rw-r--r--src/fileio.c1
2 files changed, 7 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 7ed097976a1..e875bc8a40d 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
+2014-01-26 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix crash with insert-file-contents and misdecoded text (Bug#16286).
+ * fileio.c (Finsert_file_contents): Set CODING_MODE_LAST_BLOCK
+ before invoking decode_coding_gap, since there's just one block.
+
2014-01-25 Martin Rudalics <rudalics@gmx.at>
Fix handling of face attributes in Fx_create_frame (Bug#16529).
diff --git a/src/fileio.c b/src/fileio.c
index d03a2bcf02f..22db4602249 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -4298,6 +4298,7 @@ by calling `format-decode', which see. */)
Z_BYTE -= inserted;
ZV -= inserted;
Z -= inserted;
+ coding.mode |= CODING_MODE_LAST_BLOCK;
decode_coding_gap (&coding, inserted, inserted);
inserted = coding.produced_char;
coding_system = CODING_ID_NAME (coding.id);