summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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';