]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Reassure coverity about the value passed to print_config() (CID #1504310) (#4563)
authorJames Jones <jejones3141@gmail.com>
Thu, 16 Jun 2022 18:39:55 +0000 (13:39 -0500)
committerGitHub <noreply@github.com>
Thu, 16 Jun 2022 18:39:55 +0000 (13:39 -0500)
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.

scripts/jlibtool.c

index d412fa23995c7d0243eabfda96fe4a31527319ba..3ff518d1dd28c593133a113488555ca95ff9e00b 100644 (file)
@@ -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");