Skip to content

Commit

Permalink
Fix allocation so there is enough space to put a NULL at the end of t…
Browse files Browse the repository at this point in the history
…he copied env list.
  • Loading branch information
John Schember committed Sep 11, 2013
1 parent e4178dc commit e08f7cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/fastcgi/lfcgi.c
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ static char **lf_copy_environ()
return NULL;

/* Allocate the space to hold the elements. */
env = malloc(i*sizeof(*env));
env = malloc((i+1)*sizeof(*env));

/* Copy the elements into the new array. */
i = 0;
Expand Down

0 comments on commit e08f7cb

Please sign in to comment.