Menu

Commit [r13083]  Maximize  Restore  History

Bound the prototype parameter and return lists

add_bolton splits a prototype's parameter and return lists into

char *p_params[200];
char *p_rets[200];

with no bounds check, so a prototypes file listing more than 200 of either
walked off the end of the arrays and the compiler died with

*** stack smashing detected *** : terminated

A prototypes file is input data. No input should be able to smash the
compiler's stack, whatever is wrong with it. Both loops now stop at the limit
and say so:

Prototype for <name> has more than 199 return values - ignoring the rest

mikeaubury 2026-09-05

changed /aubit4glsrc/trunk/compilers/4glc/load_prototypes.c
/aubit4glsrc/trunk/compilers/4glc/load_prototypes.c Diff Switch to side-by-side view
Loading...