Skip to content

Commit

Permalink
preprocessor: check if binary is specified before running
Browse files Browse the repository at this point in the history
Close Coverity #200024
  • Loading branch information
razvancrainea committed Jan 29, 2020
1 parent ea8fa2e commit 389d746
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions cfg_pp.c
Expand Up @@ -636,9 +636,13 @@ static int exec_preprocessor(FILE *flat_cfg, const char *preproc_cmdline,
argv = realloc(argv, (argv_len + 1) * sizeof *argv);
argv[argv_len++] = NULL;

execvp(pp_binary, argv);
LM_ERR("failed to exec preprocessor '%s': %d (%s)\n",
preproc_cmdline, errno, strerror(errno));
if (pp_binary) {
execvp(pp_binary, argv);
LM_ERR("failed to exec preprocessor '%s': %d (%s)\n",
preproc_cmdline, errno, strerror(errno));
} else
LM_ERR("no binary to run: '%s'\n", preproc_cmdline);

exit(-1);
}

Expand Down

0 comments on commit 389d746

Please sign in to comment.