Commit 4f7ebb9d authored by Ben Boeckel's avatar Ben Boeckel Committed by Kitware Robot

Merge topic 'fix-segfault'

67b71527 pv-forward.c: NULL-terminate the generated argv
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Reviewed-by: Tim Thirion's avatarTim Thirion <tim.thirion@kitware.com>
Merge-request: !478
parents 79783b65 67b71527
......@@ -285,12 +285,14 @@ int main(int argc, char** argv)
int i = 0;
int true_argc = 0;
int true_i = 0;
char **true_argv = malloc(argc * sizeof(char*));
char **true_argv = malloc((argc + 1) * sizeof(char*));
int result = 0;
FILE *driver_cache = NULL;
char driver_choice[MAX_DRIVER_CHOICE] = { 0 };
char driver_cache_path[KWSYS_SHARED_FORWARD_MAXPATH] = { 0 };
true_argv[argc] = NULL;
// Check for site-wide config first
get_driver_cache_site_path(argv[0], driver_cache_path);
driver_cache = fopen(driver_cache_path, "r");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment