From: James Jones Date: Thu, 16 Jun 2022 18:39:55 +0000 (-0500) Subject: Reassure coverity about the value passed to print_config() (CID #1504310) (#4563) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=72ce4d793a7a442d099b6db83763dd0ddd437a3d;p=thirdparty%2Ffreeradius-server.git Reassure coverity about the value passed to print_config() (CID #1504310) (#4563) We can see that print_config() is only called in one spot, from parse_long_op(), which passes as value the addresss of an auto array that is guaranteed to contain a possibly empty NUL-terminated string, suitable for the printc* macros. This being a separatly-compiled program, we take the portable approach of asserting value is non- NULL, which we know is true and should convince coverity. --- diff --git a/scripts/jlibtool.c b/scripts/jlibtool.c index d412fa23995..3ff518d1dd2 100644 --- a/scripts/jlibtool.c +++ b/scripts/jlibtool.c @@ -967,6 +967,8 @@ static int run_command(command_t *cmd, count_chars *cc) static void print_config(char const *value) { + assert(value != NULL); + printc(target->ld_run_path, "runpath_var"); printc(target->ld_library_path, "shlibpath_var"); printc(target->ld_library_path_local, "shlocallibpath_var");