ack/util
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
..
ack Cut down some clang warnings 2019-10-30 18:36:38 -04:00
amisc * More ANSI C portability fixes. 2019-03-24 23:53:13 +08:00
arch * Fix merge conflict issue. 2019-06-16 01:19:15 +08:00
ass Read beyond buffer bugfix. 2019-03-31 00:53:09 +08:00
build Run all tests, even the ones which fail, and emit a test summary right at the 2016-12-01 23:03:30 +01:00
byacc Removed a whole bunch of old strcpy() prototypes in favour of <string.h>. 2019-02-10 13:20:04 +01:00
ceg Distributions are a pain --- let's not bother any more. Instead, we just tag 2016-09-02 23:00:38 +02:00
cgg Cut down some clang warnings 2019-10-30 18:36:38 -04:00
cmisc ANSI C conversion. 2019-05-11 01:14:01 +08:00
cpp Removed a whole bunch of old strcpy() prototypes in favour of <string.h>. 2019-02-10 13:20:04 +01:00
ego Fix some issues caused by, I think, COMMON variables no longer working in 2020-09-14 22:38:01 +02:00
flex Stop using mktemp() --- on Haiku, it always generates the same filenames, 2017-08-06 13:22:05 +02:00
grind Distributions are a pain --- let's not bother any more. Instead, we just tag 2016-09-02 23:00:38 +02:00
int Add util/int/switch.h to declare do_instr() and Do???() 2019-10-30 18:36:55 -04:00
led Reduce warnings, adjust format strings in util/led 2019-11-01 18:27:34 -04:00
LLgen Fix static buffer overflow in genname( ) in LLgen 2021-03-16 17:59:29 +00:00
make * Fix compilation warning. 2019-05-11 00:49:10 +08:00
mcgg Add the OPTIONS clause to the mcgg grammar; add an optional pass which converts 2018-09-22 11:19:00 +02:00
misc ANSI C conversion. 2019-05-11 01:15:51 +08:00
ncgg Change the optional parameter of n_coerc() to a pointer 2019-10-30 18:36:56 -04:00
opt Cut down some clang warnings 2019-10-30 18:36:38 -04:00
shf Distributions are a pain --- let's not bother any more. Instead, we just tag 2016-09-02 23:00:38 +02:00
topgen Reduce clang warnings from top 2019-10-30 18:36:55 -04:00