* alloc.c (Fgc_status): Do not access beyond zombies array

boundary if nzombies > MAX_ZOMBIES.
* alloc.c (dump_zombies): Add missing format specifier.
This commit is contained in:
Dmitry Antipov 2011-10-11 23:09:40 -07:00 committed by Paul Eggert
parent b5525cacc3
commit 6e4b3fbe6d
2 changed files with 8 additions and 2 deletions

View file

@ -1,3 +1,9 @@
2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
* alloc.c (Fgc_status): Do not access beyond zombies array
boundary if nzombies > MAX_ZOMBIES.
* alloc.c (dump_zombies): Add missing format specifier.
2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
* xdisp.c (set_cursor_from_row): Simplify conditionals,

View file

@ -4071,7 +4071,7 @@ DEFUN ("gc-status", Fgc_status, Sgc_status, 0, 0, "",
{
Lisp_Object args[8], zombie_list = Qnil;
EMACS_INT i;
for (i = 0; i < nzombies; i++)
for (i = 0; i < min (MAX_ZOMBIES, nzombies); i++)
zombie_list = Fcons (zombies[i], zombie_list);
args[0] = build_string ("%d GCs, avg live/zombies = %.2f/%.2f (%f%%), max %d/%d\nzombies: %S");
args[1] = make_number (ngcs);
@ -4410,7 +4410,7 @@ dump_zombies (void)
{
int i;
fprintf (stderr, "\nZombies kept alive = %"pI":\n", nzombies);
fprintf (stderr, "\nZombies kept alive = %"pI"d:\n", nzombies);
for (i = 0; i < min (MAX_ZOMBIES, nzombies); ++i)
{
fprintf (stderr, " %d = ", i);