Do not try to interpret non-identifier tokens as pragma names.

This could access arbitrary memory locations, and could theoretically cause misbehavior including falsely recognizing the token as a pragma or accessing a softswitch/IO location.
This commit is contained in:
Stephen Heumann 2022-10-24 21:05:50 -05:00
parent 81353a9f8a
commit e0b27db652
1 changed files with 5 additions and 0 deletions

View File

@ -3328,6 +3328,11 @@ if ch in ['a','d','e','i','l','p','u','w'] then begin
if token.name^ = 'pragma' then begin
if tskipping then goto 2;
NextToken;
if token.class <> identifier then begin
if (lint & lintPragmas) <> 0 then
Error(110);
goto 2;
end; {if}
if token.name^ = 'keep' then
DoKeep
else if token.name^ = 'debug' then begin