From 5fa56976f45f04319ee0416c51dd8fd97c74d1ef Mon Sep 17 00:00:00 2001 From: DavidKorczynski Date: Thu, 26 Aug 2021 21:03:14 +0100 Subject: [PATCH] apache-httpd: fix patch for hitting assert. (#6320) --- projects/apache-httpd/patches.diff | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/projects/apache-httpd/patches.diff b/projects/apache-httpd/patches.diff index c65730072..cd0cae3de 100644 --- a/projects/apache-httpd/patches.diff +++ b/projects/apache-httpd/patches.diff @@ -1,5 +1,5 @@ diff --git a/server/apreq_parser_header.c b/server/apreq_parser_header.c -index 19588befd8..d359d7f4ea 100644 +index 19588be..ede2acf 100644 --- a/server/apreq_parser_header.c +++ b/server/apreq_parser_header.c @@ -89,6 +89,8 @@ static apr_status_t split_header_line(apreq_param_t **p, @@ -11,7 +11,7 @@ index 19588befd8..d359d7f4ea 100644 assert(nlen >= len); end->iov_len = len; nlen -= len; -@@ -103,6 +105,8 @@ static apr_status_t split_header_line(apreq_param_t **p, +@@ -103,12 +105,15 @@ static apr_status_t split_header_line(apreq_param_t **p, if (s != APR_SUCCESS) return s; @@ -20,7 +20,14 @@ index 19588befd8..d359d7f4ea 100644 assert(glen >= dlen); glen -= dlen; e = APR_BUCKET_NEXT(e); -@@ -119,6 +123,7 @@ static apr_status_t split_header_line(apreq_param_t **p, + } + + /* copy value */ ++ if (!(vlen > 0)) return APR_EBADARG; + assert(vlen > 0); + dest = v->data; + while (vlen > 0) { +@@ -119,11 +124,13 @@ static apr_status_t split_header_line(apreq_param_t **p, memcpy(dest, data, dlen); dest += dlen; @@ -28,3 +35,9 @@ index 19588befd8..d359d7f4ea 100644 assert(vlen >= dlen); vlen -= dlen; e = APR_BUCKET_NEXT(e); + } + ++ if (!(dest[-1] == '\n')) return APR_EBADARG; + assert(dest[-1] == '\n'); + + if (dest[-2] == '\r')