Reported by Alessandro Mantovani. Overly long function names would trigger out-of-bounds accesses.
Unified · Split
| @@ -813,7 +813,7 @@ parsefn(int export) · 812 unmodified lines | ||
| 813 | 813 | rcls = 5; |
| 814 | 814 | if (next() != Tglo) |
| 815 | 815 | err("function name expected"); |
| 816 | − strcpy(curf->name, tokval.str); | |
| 816 | + strncpy(curf->name, tokval.str, NString-1); | |
| 817 | 817 | curf->vararg = parserefl(0); |
| 818 | 818 | if (nextnl() != Tlbrace) |
| 819 | 819 | err("function body must start with {"); |