aboutsummaryrefslogtreecommitdiffstats
path: root/src/coding.c
diff options
context:
space:
mode:
authorRichard M. Stallman2002-02-01 04:34:21 +0000
committerRichard M. Stallman2002-02-01 04:34:21 +0000
commitb1887814c31f69bfa5620e16ade245a1650046b3 (patch)
treebc706392640c8aae14e38ebb278fa46b4f5e67ca /src/coding.c
parent345c105fa48978ce66abf87742bdd4e693bb31d8 (diff)
downloademacs-b1887814c31f69bfa5620e16ade245a1650046b3.tar.gz
emacs-b1887814c31f69bfa5620e16ade245a1650046b3.zip
(decode_composition_emacs_mule):
Give up if NCOMPONENT gets too large to index `component'.
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/coding.c b/src/coding.c
index 88ff0ca0a83..37a5e886547 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -811,6 +811,10 @@ decode_composition_emacs_mule (coding, src, src_end,
811 return 0; 811 return 0;
812 for (ncomponent = 0; src < src_base + data_len; ncomponent++) 812 for (ncomponent = 0; src < src_base + data_len; ncomponent++)
813 { 813 {
814 /* If it is longer than this, it can't be valid. */
815 if (ncomponent >= COMPOSITION_DATA_MAX_BUNCH_LENGTH)
816 return 0;
817
814 if (ncomponent % 2 && with_rule) 818 if (ncomponent % 2 && with_rule)
815 { 819 {
816 ONE_MORE_BYTE (gref); 820 ONE_MORE_BYTE (gref);