diff options
author | Graham Leggett <minfrin@apache.org> | 2021-10-21 11:21:54 +0000 |
---|---|---|
committer | Graham Leggett <minfrin@apache.org> | 2021-10-21 11:21:54 +0000 |
commit | bf6419ec7abf4ca897c133620ce64044a6c4f9d0 (patch) | |
tree | 000238d0198b5884c5462610c8e137fad4eb0550 /buckets | |
parent | 2fb0412735d96a490f74bb89c702788a6964653b (diff) | |
download | apr-bf6419ec7abf4ca897c133620ce64044a6c4f9d0.tar.gz |
apr_brigade_split_boundary: Use memmem and memcmp for comparison, allowing
binary boundaries.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1894441 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'buckets')
-rw-r--r-- | buckets/apr_brigade.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/buckets/apr_brigade.c b/buckets/apr_brigade.c index e8ec4ca3b..584d64c2d 100644 --- a/buckets/apr_brigade.c +++ b/buckets/apr_brigade.c @@ -453,7 +453,7 @@ APR_DECLARE(apr_status_t) apr_brigade_split_boundary(apr_bucket_brigade *bbOut, apr_size_t off; apr_size_t leftover; - pos = strnstr(str + ignore, boundary, len - ignore); + pos = memmem(str + ignore, len - ignore, boundary, boundary_len); /* definitely found it, we leave */ if (pos != NULL) { @@ -482,7 +482,7 @@ APR_DECLARE(apr_status_t) apr_brigade_split_boundary(apr_bucket_brigade *bbOut, off = (len - leftover); while (leftover) { - if (!strncmp(str + off, boundary, leftover)) { + if (!memcmp(str + off, boundary, leftover)) { if (off) { @@ -525,7 +525,7 @@ APR_DECLARE(apr_status_t) apr_brigade_split_boundary(apr_bucket_brigade *bbOut, /* find all definite non matches */ while (len) { - if (!strncmp(str + off, boundary, len)) { + if (!memcmp(str + off, boundary, len)) { if (off) { @@ -587,7 +587,7 @@ skip: if (len > off) { /* not a match, bail out */ - if (strncmp(str, boundary + inbytes, off)) { + if (memcmp(str, boundary + inbytes, off)) { break; } @@ -610,7 +610,7 @@ skip: if (len == off) { /* not a match, bail out */ - if (strncmp(str, boundary + inbytes, off)) { + if (memcmp(str, boundary + inbytes, off)) { break; } @@ -631,7 +631,7 @@ skip: else if (len) { /* not a match, bail out */ - if (strncmp(str, boundary + inbytes, len)) { + if (memcmp(str, boundary + inbytes, len)) { break; } |