* alloc.c (gc_sweep): Don't read past end of array.
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 13 Jul 2011 01:04:29 +0000 (18:04 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 13 Jul 2011 01:04:29 +0000 (18:04 -0700)
In theory, the old code could also have corrupted Emacs internals,
though it'd be very unlikely.

src/ChangeLog
src/alloc.c

index 07c707e..386ed43 100644 (file)
@@ -1,3 +1,9 @@
+2011-07-13  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * alloc.c (gc_sweep): Don't read past end of array.
+       In theory, the old code could also have corrupted Emacs internals,
+       though it'd be very unlikely.
+
 2011-07-12  Andreas Schwab  <schwab@linux-m68k.org>
 
        * character.c (Fcharacterp): Don't advertise optional ignored
index 6ba080c..44f935c 100644 (file)
@@ -5733,7 +5733,7 @@ gc_sweep (void)
        int ilim = (lim + BITS_PER_INT - 1) / BITS_PER_INT;
 
        /* Scan the mark bits an int at a time.  */
-       for (i = 0; i <= ilim; i++)
+       for (i = 0; i < ilim; i++)
          {
            if (cblk->gcmarkbits[i] == -1)
              {