summaryrefslogtreecommitdiff
path: root/xs_httpd.h
diff options
context:
space:
mode:
authordefault <nobody@localhost>2022-12-11 10:33:01 +0100
committerdefault <nobody@localhost>2022-12-11 10:33:01 +0100
commitaa82e14bc7e7a3770feb23446d1a843d97213ccf (patch)
treeb4c0758aae4b5fa9a8b0c6282f7e45b2ab57eb9a /xs_httpd.h
parent0337c71cf45e9b646c1cd4cb39426073623267f2 (diff)
Backport from xs.
Diffstat (limited to 'xs_httpd.h')
-rw-r--r--xs_httpd.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/xs_httpd.h b/xs_httpd.h
index 454d786..4dad72a 100644
--- a/xs_httpd.h
+++ b/xs_httpd.h
@@ -131,13 +131,13 @@ d_char *_xs_multipart_form_data(char *payload, int p_size, char *header)
}
/* find the start of the part content */
- if ((p = xs_memmem(p, p_size - offset, "\r\n\r\n", 4)) == NULL)
+ if ((p = xs_memmem(p, p_size - (p - payload), "\r\n\r\n", 4)) == NULL)
break;
p += 4;
/* find the next boundary */
- if ((q = xs_memmem(p, p_size - offset, boundary, bsz)) == NULL)
+ if ((q = xs_memmem(p, p_size - (p - payload), boundary, bsz)) == NULL)
break;
po = p - payload;