changeset 43041:983767b5ccc0

(decode_composition_emacs_mule): Give up if NCOMPONENT gets too large to index `component'.
author Richard M. Stallman <rms@gnu.org>
date Fri, 01 Feb 2002 04:34:21 +0000
parents 6502ac0cd978
children 63639e690611
files src/coding.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/coding.c	Fri Feb 01 04:32:56 2002 +0000
+++ b/src/coding.c	Fri Feb 01 04:34:21 2002 +0000
@@ -811,6 +811,10 @@
 	return 0;
       for (ncomponent = 0; src < src_base + data_len; ncomponent++)
 	{
+	  /* If it is longer than this, it can't be valid.  */
+	  if (ncomponent >= COMPOSITION_DATA_MAX_BUNCH_LENGTH)
+	    return 0;
+
 	  if (ncomponent % 2 && with_rule)
 	    {
 	      ONE_MORE_BYTE (gref);