aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xs_url.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/xs_url.h b/xs_url.h
index 56d6d9d..ef35a4b 100644
--- a/xs_url.h
+++ b/xs_url.h
@@ -289,6 +289,9 @@ xs_dict *xs_multipart_form_data(const char *payload, int p_size, const char *hea
po = p - payload;
ps = q - p - 2; /* - 2 because the final \r\n */
+ if (ps <= 0)
+ break;
+
/* is it a filename? */
if (fn != NULL) {
/* p_var value is a list */