From b397fbbe7a1d2cbf65f7661eeece4dd39dedd5be Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Mon, 4 Jan 2010 12:21:06 +0000 Subject: 27556: sanitize more variables in lexsave() avoiding crashes in inner loops --- Src/lex.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Src') diff --git a/Src/lex.c b/Src/lex.c index f7e87477a..f25bd3eca 100644 --- a/Src/lex.c +++ b/Src/lex.c @@ -248,8 +248,11 @@ lexsave(void) ls->histactive = histactive; ls->histdone = histdone; ls->stophist = stophist; + stophist = 0; ls->hline = chline; + chline = NULL; ls->hptr = hptr; + hptr = NULL; ls->hlinesz = hlinesz; ls->cstack = cmdstack; ls->csp = cmdsp; @@ -259,7 +262,9 @@ lexsave(void) ls->tokstr = tokstr; ls->zshlextext = zshlextext; ls->bptr = bptr; + tokstr = zshlextext = bptr = NULL; ls->bsiz = bsiz; + bsiz = 256; ls->len = len; ls->chwords = chwords; ls->chwordlen = chwordlen; -- cgit 1.4.1