diff options
| -rw-r--r-- | xs.h | 3 | ||||
| -rw-r--r-- | xs_httpd.h | 4 | ||||
| -rw-r--r-- | xs_version.h | 2 |
3 files changed, 5 insertions, 4 deletions
| @@ -914,7 +914,8 @@ void *xs_memmem(const char *haystack, int h_size, const char *needle, int n_size | |||
| 914 | char *p, *r = NULL; | 914 | char *p, *r = NULL; |
| 915 | int offset = 0; | 915 | int offset = 0; |
| 916 | 916 | ||
| 917 | while (!r && h_size - offset > n_size && (p = strchr(haystack + offset, *needle))) { | 917 | while (!r && h_size - offset > n_size && |
| 918 | (p = memchr(haystack + offset, *needle, h_size - offset))) { | ||
| 918 | if (memcmp(p, needle, n_size) == 0) | 919 | if (memcmp(p, needle, n_size) == 0) |
| 919 | r = p; | 920 | r = p; |
| 920 | else | 921 | else |
| @@ -131,13 +131,13 @@ d_char *_xs_multipart_form_data(char *payload, int p_size, char *header) | |||
| 131 | } | 131 | } |
| 132 | 132 | ||
| 133 | /* find the start of the part content */ | 133 | /* find the start of the part content */ |
| 134 | if ((p = xs_memmem(p, p_size - offset, "\r\n\r\n", 4)) == NULL) | 134 | if ((p = xs_memmem(p, p_size - (p - payload), "\r\n\r\n", 4)) == NULL) |
| 135 | break; | 135 | break; |
| 136 | 136 | ||
| 137 | p += 4; | 137 | p += 4; |
| 138 | 138 | ||
| 139 | /* find the next boundary */ | 139 | /* find the next boundary */ |
| 140 | if ((q = xs_memmem(p, p_size - offset, boundary, bsz)) == NULL) | 140 | if ((q = xs_memmem(p, p_size - (p - payload), boundary, bsz)) == NULL) |
| 141 | break; | 141 | break; |
| 142 | 142 | ||
| 143 | po = p - payload; | 143 | po = p - payload; |
diff --git a/xs_version.h b/xs_version.h index 5b9a4cf..802072a 100644 --- a/xs_version.h +++ b/xs_version.h | |||
| @@ -1 +1 @@ | |||
| /* 3aa82bc4fc310ec95194602bed88a9767e100350 */ | /* d5a6108812a499a389030a1402ce49f282b4a818 */ | ||