diff options
| author | Michael Forney | 2019-05-08 01:38:19 -0700 |
|---|---|---|
| committer | Quentin Carbonneaux | 2019-05-15 10:52:47 +0200 |
| commit | 60d16fd50aaaf4fec3014376f14cea62cb9aa5a9 (patch) | |
| tree | 86703ecfa933db32398301d46bf3f1a4ab68d01e | |
| parent | e3827acb73055d2e3b16deaecd83574af7a08399 (diff) | |
Fail on invalid token
Reading a zero-length TIdnt token causes infinite loops or other failures.
| -rw-r--r-- | yacc.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -837,6 +837,8 @@ nexttk() die("identifier too long"); c = fgetc(fin); } + if (p == idnt) + die("unknown token"); *p = 0; if (strcmp(idnt, "%")==0) if (c=='{') |
