summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar default2024-09-14 14:43:22 +0200
committerGravatar default2024-09-14 14:43:22 +0200
commit7e85cd570d78fad7375917b3fcc4ee5cfacfeaab (patch)
tree403fd7ae56b718db04ce7f1590390d35737f9056
parentUpdated documentation. (diff)
downloadpenes-snac2-7e85cd570d78fad7375917b3fcc4ee5cfacfeaab.tar.gz
penes-snac2-7e85cd570d78fad7375917b3fcc4ee5cfacfeaab.tar.xz
penes-snac2-7e85cd570d78fad7375917b3fcc4ee5cfacfeaab.zip
Fixed crash in xs_multipart_form_data().
Diffstat (limited to '')
-rw-r--r--xs_url.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/xs_url.h b/xs_url.h
index efc883b..d6dd47a 100644
--- a/xs_url.h
+++ b/xs_url.h
@@ -143,6 +143,11 @@ xs_dict *xs_multipart_form_data(const char *payload, int p_size, const char *hea
143 if (p[0] == 13 && p[1] == 10) 143 if (p[0] == 13 && p[1] == 10)
144 break; 144 break;
145 q = strchr(p, '\r'); 145 q = strchr(p, '\r');
146
147 /* unexpected formatting, fail immediately */
148 if (q == NULL)
149 return p_vars;
150
146 s1 = xs_realloc(NULL, q - p + 1); 151 s1 = xs_realloc(NULL, q - p + 1);
147 memcpy(s1, p, q - p); 152 memcpy(s1, p, q - p);
148 s1[q - p] = '\0'; 153 s1[q - p] = '\0';