In early November 2022 builds on FreeBSD 12/amd64 saw makedep core dump 1791 times due to it being invoked with a NULL pointer. Turns out it did not validate its input for being non-NULL, so add such a check and add a diagnostics.
From: Gerald Pfeifer gerald@pfeifer.com
In early November 2022 builds on FreeBSD 12/amd64 saw makedep core dump 1791 times due to it being invoked with a NULL pointer. Turns out it did not validate its input for being non-NULL, so add such a check and add a diagnostics. --- tools/makedep.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/tools/makedep.c b/tools/makedep.c index 6379b5b69d9..a75ed3c10b8 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -384,6 +384,12 @@ static void strarray_set_value( struct strarray *array, const char *name, const */ static void output_filename( const char *name ) { + if( ! name ) + { + fprintf(stderr, "makedep error: NULL string passed to output_filename\n"); + return; + } + if (output_column + strlen(name) + 1 > 100) { output( " \\n" );
I don't think that's an improvement. A crash with a backtrace is a lot easier to figure out than a simple warning without any context, particularly since output_filename is used all over the place.
This merge request was closed by Alexandre Julliard.