From 2941c447ebada8126c27065f78c31895f69c738e Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 12 Jul 2011 18:15:33 -0700 Subject: [PATCH] * buffer.c (Fget_buffer_create): Initialized inhibit_shrinking. The old code sometimes used this field without initializing it. --- src/ChangeLog | 3 +++ src/buffer.c | 1 + 2 files changed, 4 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 386ed435b2a..e8824f3a15f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2011-07-13 Paul Eggert + * buffer.c (Fget_buffer_create): Initialized inhibit_shrinking. + The old code sometimes used this field without initializing it. + * 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/buffer.c b/src/buffer.c index 1b8b1117893..776888e30ac 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -361,6 +361,7 @@ even if it is dead. The return value is never nil. */) BUF_END_UNCHANGED (b) = 0; BUF_BEG_UNCHANGED (b) = 0; *(BUF_GPT_ADDR (b)) = *(BUF_Z_ADDR (b)) = 0; /* Put an anchor '\0'. */ + b->text->inhibit_shrinking = 0; b->newline_cache = 0; b->width_run_cache = 0; -- 2.39.5