History

fix buffer overflow in parser (afl)

Reported by Alessandro Mantovani. Overly long function names would trigger out-of-bounds accesses.

Quentin Carbonneaux committed 5 years ago

Commit 5a4369d1 parent 7f4ab8d1 file · +1 −1Browse files

Unified · Split

parse.c+1−1
@@ -813,7 +813,7 @@ parsefn(int export) · 812 unmodified lines
813813 rcls = 5;
814814 if (next() != Tglo)
815815 err("function name expected");
816− strcpy(curf->name, tokval.str);
816+ strncpy(curf->name, tokval.str, NString-1);
817817 curf->vararg = parserefl(0);
818818 if (nextnl() != Tlbrace)
819819 err("function body must start with {");

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t