summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar default2025-02-06 20:10:52 +0100
committerGravatar default2025-02-06 20:10:52 +0100
commit3099d179be9ffb38753e412480e23e5391913751 (patch)
treec1018e0565b8d186991e52c9c9975d1ae5a42971
parentIf 'def_timeline_entries' is not set, 'max_timeline_entries' is used (instead... (diff)
downloadpenes-snac2-3099d179be9ffb38753e412480e23e5391913751.tar.gz
penes-snac2-3099d179be9ffb38753e412480e23e5391913751.tar.xz
penes-snac2-3099d179be9ffb38753e412480e23e5391913751.zip
Fixed a crash in xs_multipart_form_data().
-rw-r--r--xs_url.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/xs_url.h b/xs_url.h
index bb31779..37d2391 100644
--- a/xs_url.h
+++ b/xs_url.h
@@ -274,7 +274,8 @@ xs_dict *xs_multipart_form_data(const char *payload, int p_size, const char *hea
274 l1 = xs_list_append(l1, vpo); 274 l1 = xs_list_append(l1, vpo);
275 l1 = xs_list_append(l1, vps); 275 l1 = xs_list_append(l1, vps);
276 276
277 p_vars = xs_dict_append(p_vars, vn, l1); 277 if (xs_is_string(vn))
278 p_vars = xs_dict_append(p_vars, vn, l1);
278 } 279 }
279 else { 280 else {
280 /* regular variable; just copy */ 281 /* regular variable; just copy */
@@ -282,7 +283,8 @@ xs_dict *xs_multipart_form_data(const char *payload, int p_size, const char *hea
282 memcpy(vc, payload + po, ps); 283 memcpy(vc, payload + po, ps);
283 vc[ps] = '\0'; 284 vc[ps] = '\0';
284 285
285 p_vars = xs_dict_append(p_vars, vn, vc); 286 if (xs_is_string(vn) && xs_is_string(vc))
287 p_vars = xs_dict_append(p_vars, vn, vc);
286 } 288 }
287 289
288 /* move on */ 290 /* move on */