ack/util/LLgen/src
Tee-Kiah Chia 9c7ce04cec Fix static buffer overflow in genname( ) in LLgen
This should fix at least some instances of the "undefined
reference to `LLnc_recover'" error that happens in some
builds (https://github.com/davidgiven/ack/issues/218).

The bug was that genname( ) used a static `namebuf' buffer
and did not properly check for overflow when writing into
it.  The result was that the `non_corr' variable was
sometimes overwritten with a non-zero value when it should
be zero, causing bogus results later.

This proposed patch makes genname( ) dynamically allocate
and resize a buffer for holding a target file name.

I also take this chance to fix a typo in correct_prefix().
2021-03-16 17:59:29 +00:00
..
alloc.c LLgen: use size_t, reduce warnings, other small changes 2019-10-22 15:32:23 -04:00
cclass.c Added non-correcting error recovery stuff 1997-02-21 11:27:57 +00:00
cclass.h Added non-correcting error recovery stuff 1997-02-21 11:27:57 +00:00
check.c Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
compute.c LLgen: use size_t, reduce warnings, other small changes 2019-10-22 15:32:23 -04:00
extern.h LLgen: use size_t, reduce warnings, other small changes 2019-10-22 15:32:23 -04:00
gencode.c Fix static buffer overflow in genname( ) in LLgen 2021-03-16 17:59:29 +00:00
global.c Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
io.h Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
LLgen.c LLgen: use size_t, reduce warnings, other small changes 2019-10-22 15:32:23 -04:00
LLgen.g LLgen: use size_t, reduce warnings, other small changes 2019-10-22 15:32:23 -04:00
Lpars.c LLgen: use size_t, reduce warnings, other small changes 2019-10-22 15:32:23 -04:00
Lpars.h Added pregenerated versions of the LLgen source files (to ease 2007-02-24 02:01:57 +00:00
machdep.c LLgen: use size_t, reduce warnings, other small changes 2019-10-22 15:32:23 -04:00
main.c LLgen: use size_t, reduce warnings, other small changes 2019-10-22 15:32:23 -04:00
name.c LLgen: use size_t, reduce warnings, other small changes 2019-10-22 15:32:23 -04:00
reach.c Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
savegram.c LLgen: use size_t, reduce warnings, other small changes 2019-10-22 15:32:23 -04:00
sets.c LLgen: use size_t, reduce warnings, other small changes 2019-10-22 15:32:23 -04:00
sets.h Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
tokens.c LLgen: use size_t, reduce warnings, other small changes 2019-10-22 15:32:23 -04:00
tokens.g LLgen: use size_t, reduce warnings, other small changes 2019-10-22 15:32:23 -04:00
types.h LLgen: use size_t, reduce warnings, other small changes 2019-10-22 15:32:23 -04:00