From bc5b0254d0b86c4b11637de14dab55e191388dc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigrid=20Solveig=20Hafl=C3=ADnud=C3=B3ttir?= Date: Mon, 28 Mar 2022 17:23:04 +0000 Subject: [PATCH] pc: do not access out of bounds array element --- sys/src/cmd/pc.y | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/src/cmd/pc.y b/sys/src/cmd/pc.y index 5bbea3212..8e0fedf32 100644 --- a/sys/src/cmd/pc.y +++ b/sys/src/cmd/pc.y @@ -636,7 +636,7 @@ yylex(void) yylval.sym = getsym(buf, 1); return LSYMB; } - if(c < 128 && (kw = optab[c], kw != nil)){ + if(c >= 0 && c < 128 && (kw = optab[c], kw != nil)){ b = Bgetc(in); for(; kw->name[0] == c; kw++) if(kw->name[0] == b)