Michal Hlavinka from Red Hat found another SIGSEGV

fix: when iterating over all Sources, know when to stop…
This commit is contained in:
tg
2010-07-21 11:31:16 +00:00
parent c6eedad976
commit c11d35312a
3 changed files with 17 additions and 6 deletions

4
lex.c
View File

@ -22,7 +22,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.116 2010/07/17 22:09:36 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.117 2010/07/21 11:31:15 tg Exp $");
/*
* states while lexing word
@ -1110,7 +1110,7 @@ yylex(int cf)
else {
Source *s = source;
while (s->flags & SF_HASALIAS)
while (s && (s->flags & SF_HASALIAS))
if (s->u.tblp == p)
return (LWORD);
else