diff options
| author | Quentin Carbonneaux <quentin@c9x.me> | 2021-07-28 00:53:09 +0200 |
|---|---|---|
| committer | Quentin Carbonneaux <quentin@c9x.me> | 2021-07-28 00:53:09 +0200 |
| commit | 5a4369dd279b1ee50779ae4ab16daaa035eeeb69 (patch) | |
| tree | abb1617109526574d9311ac56d7a22edc5256f83 | |
| parent | 7f4ab8d801edd1db8518ecd110c53483f847a8e9 (diff) | |
| download | roux-5a4369dd279b1ee50779ae4ab16daaa035eeeb69.tar.gz | |
fix buffer overflow in parser (afl)
Reported by Alessandro Mantovani. Overly long function names would trigger out-of-bounds accesses.
| -rw-r--r-- | parse.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/parse.c b/parse.c index 48f2f6e..a7e4452 100644 --- a/parse.c +++ b/parse.c @@ -813,7 +813,7 @@ parsefn(int export) rcls = 5; if (next() != Tglo) err("function name expected"); - strcpy(curf->name, tokval.str); + strncpy(curf->name, tokval.str, NString-1); curf->vararg = parserefl(0); if (nextnl() != Tlbrace) err("function body must start with {"); |
