From: Paul Eggert Date: Wed, 13 Jul 2011 01:04:29 +0000 (-0700) Subject: * alloc.c (gc_sweep): Don't read past end of array. X-Git-Tag: emacs-pretest-24.0.90~104^2~334 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=47ea7f442f7d85f29b7200ada8755e6ebf5c0819;p=emacs.git * 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. --- diff --git a/src/ChangeLog b/src/ChangeLog index 07c707eacdc..386ed435b2a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2011-07-13 Paul Eggert + + * 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 * character.c (Fcharacterp): Don't advertise optional ignored diff --git a/src/alloc.c b/src/alloc.c index 6ba080c0b4c..44f935c243d 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -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) {