[PATCH 0/1] MR1855: makedep: Make output_filename more resilient
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. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/1855
From: Gerald Pfeifer <gerald(a)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" ); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/1855
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. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/1855#note_19913
This merge request was closed by Alexandre Julliard. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/1855
participants (3)
-
Alexandre Julliard (@julliard) -
Gerald Pfeifer -
Gerald Pfeifer (@gerald)