From ac05f84854833da085c9503765f462a29c3bc719 Mon Sep 17 00:00:00 2001 From: Toby Goodwin Date: Tue, 14 Apr 2015 23:36:05 +0100 Subject: in initinput() ungetcount was used uninitialized --- ChangeLog | 8 ++++++++ input.c | 1 + 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index cf9dfeb..195941e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -864,3 +864,11 @@ Changes since rc-1.5b2 Portability: the comment from 1999-08-19 may well have been true at the time, but the final version of the C99 standard called varargs copying macro va_copy(). + +2015-04-14 + + Bug: in initinput(), the call ugchar(EOF) used the ungetcount member + of the top Input structure without initializing it. Thanks to Jeff + Johnson for finding this, Robert Scheck for reporting it, and Uli + Drepper for implementing MALLOC_PERTURB_, a cheap way to find uses of + uninitialized memory. diff --git a/input.c b/input.c index df597c4..5737375 100644 --- a/input.c +++ b/input.c @@ -163,6 +163,7 @@ void termchange(void) { extern void initinput() { istack = itop = ealloc(istacksize = 256 * sizeof (Input)); + istack->ungetcount = 0; ugchar(EOF); } -- cgit v1.2.3