aboutsummaryrefslogtreecommitdiff
path: root/src/daemon/session.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/daemon/session.c')
-rw-r--r--src/daemon/session.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/daemon/session.c b/src/daemon/session.c
index b458cad7..62e05edd 100644
--- a/src/daemon/session.c
+++ b/src/daemon/session.c
@@ -384,7 +384,7 @@ MHD_build_header_response(struct MHD_Session * session) {
384 pos = pos->next; 384 pos = pos->next;
385 } 385 }
386 /* produce data */ 386 /* produce data */
387 data = malloc(size); 387 data = malloc(size + 1);
388 memcpy(data, 388 memcpy(data,
389 code, 389 code,
390 off); 390 off);
@@ -397,6 +397,9 @@ MHD_build_header_response(struct MHD_Session * session) {
397 off += strlen(pos->header) + strlen(pos->value) + 4; 397 off += strlen(pos->header) + strlen(pos->value) + 4;
398 pos = pos->next; 398 pos = pos->next;
399 } 399 }
400 sprintf(&data[off],
401 "\r\n");
402 off += 2;
400 if (off != size) 403 if (off != size)
401 abort(); 404 abort();
402 session->write_buffer = data; 405 session->write_buffer = data;