summaryrefslogtreecommitdiff
path: root/xs_fcgi.h
diff options
context:
space:
mode:
Diffstat (limited to 'xs_fcgi.h')
-rw-r--r--xs_fcgi.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/xs_fcgi.h b/xs_fcgi.h
index 97f14d5..50115b1 100644
--- a/xs_fcgi.h
+++ b/xs_fcgi.h
@@ -222,7 +222,11 @@ xs_dict *xs_fcgi_request(FILE *f, xs_str **payload, int *p_size, int *fcgi_id)
b_size += psz;
}
else {
- /* the packet is complete; fill the payload info and finish */
+ /* add an asciiz to be able to treat it as a string */
+ buf = xs_realloc(buf, _xs_blk_size(b_size + 1));
+ buf[b_size] = '\0';
+
+ /* fill the payload info and finish */
*payload = (xs_str *)buf;
*p_size = b_size;