rc

[fork] interactive rc shell
Log | Files | Refs | README | LICENSE

commit ac05f84854833da085c9503765f462a29c3bc719
parent 6ca78ba8c54c4ba6105e04119c5e8146aefa40bd
Author: Toby Goodwin <toby@paccrat.org>
Date:   Tue, 14 Apr 2015 23:36:05 +0100

in initinput() ungetcount was used uninitialized

Diffstat:
MChangeLog | 8++++++++
Minput.c | 1+
2 files changed, 9 insertions(+), 0 deletions(-)

diff --git 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 @@ -163,6 +163,7 @@ void termchange(void) { extern void initinput() { istack = itop = ealloc(istacksize = 256 * sizeof (Input)); + istack->ungetcount = 0; ugchar(EOF); }