Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
spawn: fix stack overflow
  • Loading branch information
perexg committed Mar 23, 2015
1 parent a139c25 commit 1063fbf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/spawn.c
Expand Up @@ -411,7 +411,7 @@ spawn_and_give_stdout(const char *prog, char *argv[], char *envp[],
if (!argv) argv = (void *)local_argv;
if (!argv[0]) {
if (argv != (void *)local_argv) {
for (i = 1, e = argv; *e; i++, e++);
for (i = 1, e = argv + 1; *e; i++, e++);
i = (i + 1) * sizeof(char *);
e = alloca(i);
memcpy(e, argv, i);
Expand Down

0 comments on commit 1063fbf

Please sign in to comment.