Permalink
Browse files

Fix a null pointer dereference, if initial walloc() fails or wrealloc…

…() fails
  • Loading branch information...
K. Reid Wightman
K. Reid Wightman committed Oct 18, 2017
1 parent 32deeb0 commit 5e6be61e42448f503e75e287dc332b1ecbf2a665
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/cgi.c
View
@@ -137,7 +137,7 @@ PUBLIC bool cgiHandler(Webs *wp)
if (strchr(wp->query, '=') == NULL) {
query = sclone(wp->query);
websDecodeUrl(query, query, strlen(query));
for (cp = stok(query, " ", &tok); cp != NULL; ) {
for (cp = stok(query, " ", &tok); cp != NULL && argp != NULL; ) {
*(argp+n) = cp;
trace(5, "ARG[%d] %s", n, argp[n-1]);
n++;

0 comments on commit 5e6be61

Please sign in to comment.