aboutsummaryrefslogtreecommitdiffstats
path: root/src/coding.c
diff options
context:
space:
mode:
authorKenichi Handa2004-03-09 12:27:26 +0000
committerKenichi Handa2004-03-09 12:27:26 +0000
commit6eced09c3d950ee9cfa90b9ce04a998647197b3b (patch)
treea2d17e6978e660d0ab1a8d4963e78c2a3727d15d /src/coding.c
parent4f918f606bd43ea796441a75fa27414efc0e03f8 (diff)
downloademacs-6eced09c3d950ee9cfa90b9ce04a998647197b3b.tar.gz
emacs-6eced09c3d950ee9cfa90b9ce04a998647197b3b.zip
(decode_coding_emacs_mule): Handle insufficent source correctly.
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/coding.c b/src/coding.c
index 62c761c5bcf..76ef3026a2d 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -1024,9 +1024,26 @@ decode_coding_emacs_mule (coding, source, destination, src_bytes, dst_bytes)
1024 } 1024 }
1025 else 1025 else
1026 { 1026 {
1027 bytes = CHAR_STRING (*src, tmp); 1027 int i, c;
1028 p = tmp; 1028
1029 bytes = BYTES_BY_CHAR_HEAD (*src);
1029 src++; 1030 src++;
1031 for (i = 1; i < bytes; i++)
1032 {
1033 ONE_MORE_BYTE (c);
1034 if (CHAR_HEAD_P (c))
1035 break;
1036 }
1037 if (i < bytes)
1038 {
1039 bytes = CHAR_STRING (*src_base, tmp);
1040 p = tmp;
1041 src = src_base + 1;
1042 }
1043 else
1044 {
1045 p = src_base;
1046 }
1030 } 1047 }
1031 if (dst + bytes >= (dst_bytes ? dst_end : src)) 1048 if (dst + bytes >= (dst_bytes ? dst_end : src))
1032 { 1049 {