]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Sync r1895020 and r1895021 from libapreq.
authorYann Ylavic <ylavic@apache.org>
Sun, 14 Nov 2021 11:22:07 +0000 (11:22 +0000)
committerYann Ylavic <ylavic@apache.org>
Sun, 14 Nov 2021 11:22:07 +0000 (11:22 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1895023 13f79535-47bb-0310-9956-ffa450edef68

server/apreq_parser_multipart.c
server/apreq_util.c

index e4c4d71b91e41533ea8a53bf0eb175d8a15819ca..a6c0151367a8c53c41ce586e84bd2f07476c81c5 100644 (file)
@@ -240,6 +240,8 @@ struct mfd_ctx * create_multipart_context(const char *content_type,
                                (const char **)&ctx->bdry, &blen);
     if (s != APR_SUCCESS)
         return NULL; /* missing boundary */
+    if (!ctx->bdry || !*ctx->bdry)
+        return NULL; /* boundary with no or empty value */
 
     ctx->bdry[blen] = 0;
 
index eba8b8b3f6903d816037da5a25cdaf1dee840972..11b66f9a1475d1ba64fbdf2176c74cd6c4ed0ee6 100644 (file)
@@ -868,7 +868,7 @@ APREQ_DECLARE(apr_status_t)
         case '=':
         case ';':
         case ',':
-            v = hde + 1;
+            v = hde;
             hde -= tail;
             break;
         case ' ':
@@ -891,12 +891,13 @@ APREQ_DECLARE(apr_status_t)
         }
 
         /* Parse the value => (*val, *vlen) */
-        if (v[-1] == '=') {
+        if (*v == '=') {
             if (hde == hdr) {
                 /* The name can't be empty */
                 return APREQ_ERROR_BADATTR;
             }
 
+            ++v;
             while (IS_SPACE_CHAR(*v))
                 ++v;