summaryrefslogtreecommitdiffstats
path: root/server/apreq_parser_header.c
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2021-11-15 15:56:23 +0100
committerYann Ylavic <ylavic@apache.org>2021-11-15 15:56:23 +0100
commitce2509b302b114637540760e2b27a1b360f35e29 (patch)
tree649382824d591ce182ff903ef3362b09a6ec6a3e /server/apreq_parser_header.c
parentSync r1895020 and r1895021 from libapreq. (diff)
downloadapache2-ce2509b302b114637540760e2b27a1b360f35e29.tar.xz
apache2-ce2509b302b114637540760e2b27a1b360f35e29.zip
Sync r1895054 from libapreq.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1895055 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server/apreq_parser_header.c')
-rw-r--r--server/apreq_parser_header.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/server/apreq_parser_header.c b/server/apreq_parser_header.c
index 3f58214ec1..6f72f563fd 100644
--- a/server/apreq_parser_header.c
+++ b/server/apreq_parser_header.c
@@ -81,7 +81,7 @@ static apr_status_t consume_header_line(apreq_param_t **p,
char *dest;
const char *data;
apr_size_t dlen;
- int i;
+ int i, eol = 0;
param = apreq_param_make(pool, NULL, nlen, NULL, vlen);
*(const apreq_value_t **)&v = &param->v;
@@ -138,7 +138,9 @@ static apr_status_t consume_header_line(apreq_param_t **p,
for (off = 0; off < dlen; ++off) {
const char ch = data[off];
if (ch == '\r' || ch == '\n') {
- /* skip continuation CRLF(s) */
+ /* Eat [CR]LF of continuation or end of line */
+ if (!vlen && ch == '\n')
+ eol = 1; /* done */
continue;
}
assert(vlen > 0);
@@ -148,7 +150,7 @@ static apr_status_t consume_header_line(apreq_param_t **p,
}
e = APR_BUCKET_NEXT(e);
- } while (vlen > 0);
+ } while (!eol);
v->dlen = dest - v->data;
*dest++ = 0;