From 32fc5fddd0900b446600dbf05e88d44187d4b5f5 Mon Sep 17 00:00:00 2001 From: hhm Date: Wed, 17 Sep 2014 07:32:34 -0400 Subject: [PATCH] B"H net_io.c: http server: content should be dynamically allocated --- net_io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net_io.c b/net_io.c index 10e09d0..4a19429 100644 --- a/net_io.c +++ b/net_io.c @@ -749,7 +749,7 @@ int handleHTTPRequest(struct client *c, char *p) { hrp = realpath(HTMLPATH, NULL); hrp = (hrp ? hrp : HTMLPATH); clen = -1; - content = "Server error"; + content = calloc(1, 1); if (rp && (!strncmp(hrp, rp, strlen(hrp)))) { if (stat(getFile, &sbuf) != -1 && (fd = open(getFile, O_RDONLY)) != -1) { content = (char *) malloc(sbuf.st_size);