You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by yl...@apache.org on 2021/11/15 14:56:23 UTC

svn commit: r1895055 - /httpd/httpd/trunk/server/apreq_parser_header.c

Author: ylavic
Date: Mon Nov 15 14:56:23 2021
New Revision: 1895055

URL: http://svn.apache.org/viewvc?rev=1895055&view=rev
Log:
Sync r1895054 from libapreq.


Modified:
    httpd/httpd/trunk/server/apreq_parser_header.c

Modified: httpd/httpd/trunk/server/apreq_parser_header.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/apreq_parser_header.c?rev=1895055&r1=1895054&r2=1895055&view=diff
==============================================================================
--- httpd/httpd/trunk/server/apreq_parser_header.c (original)
+++ httpd/httpd/trunk/server/apreq_parser_header.c Mon Nov 15 14:56:23 2021
@@ -81,7 +81,7 @@ static apr_status_t consume_header_line(
     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(
         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(
         }
 
         e = APR_BUCKET_NEXT(e);
-    } while (vlen > 0);
+    } while (!eol);
     v->dlen = dest - v->data;
     *dest++ = 0;