summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'util.c')
-rw-r--r--util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/util.c b/util.c
index 207024a..b1f4c69 100644
--- a/util.c
+++ b/util.c
@@ -92,7 +92,7 @@ int get(char *host, char *path, char *sendcookie, char *savecookie, char **buf)
}
*buf = realloc(*buf, sizeof(char *) * (l+BUFSIZ));
- for(; (res = recv(fd, *buf+l, BUFSIZ, 0)) > 0; l+=res)
+ for(; buf != NULL && (res = recv(fd, *buf+l, BUFSIZ, 0)) > 0; l+=res)
*buf = realloc(*buf, sizeof(char *) * (l+BUFSIZ));
return l;