mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-24 11:41:58 +00:00
cmd/yacc: do not create an out of bounds pointer
An out of bounds pointer/array index being created is an error in standard C. Updates #313 Change-Id: I7108fcde1a8e03017e9ab852adb737940489c827
This commit is contained in:
parent
7ba9f9467d
commit
4a3f20bcee
1 changed files with 2 additions and 1 deletions
|
@ -2819,8 +2819,9 @@ stin(int i)
|
|||
for(n = -maxoff; n < ACTSIZE; n++) {
|
||||
flag = 0;
|
||||
for(r = q1; r < q2; r += 2) {
|
||||
if((s = *r + n + amem) < amem)
|
||||
if(*r + n < 0)
|
||||
goto nextn;
|
||||
s = *r + n + amem;
|
||||
if(*s == 0)
|
||||
flag++;
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue