Commit 67b71527 authored by Ben Boeckel's avatar Ben Boeckel

pv-forward.c: NULL-terminate the generated argv

parent 79783b65
......@@ -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