summaryrefslogtreecommitdiff
path: root/xs_url.h
diff options
context:
space:
mode:
Diffstat (limited to 'xs_url.h')
-rw-r--r--xs_url.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/xs_url.h b/xs_url.h
index 56d6d9d..e25c73b 100644
--- a/xs_url.h
+++ b/xs_url.h
@@ -312,12 +312,14 @@ xs_dict *xs_multipart_form_data(const char *payload, int p_size, const char *hea
312 } 312 }
313 else { 313 else {
314 /* regular variable; just copy */ 314 /* regular variable; just copy */
315 xs *vc = xs_realloc(NULL, ps + 1); 315 if (ps > 0) {
316 memcpy(vc, payload + po, ps); 316 xs *vc = xs_realloc(NULL, ps + 1);
317 vc[ps] = '\0'; 317 memcpy(vc, payload + po, ps);
318 vc[ps] = '\0';
318 319
319 if (xs_is_string(vn) && xs_is_string(vc)) 320 if (xs_is_string(vn) && xs_is_string(vc))
320 p_vars = xs_dict_append(p_vars, vn, vc); 321 p_vars = xs_dict_append(p_vars, vn, vc);
322 }
321 } 323 }
322 324
323 /* move on */ 325 /* move on */