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/12 21:47:09 UTC
svn commit: r1894986 - /httpd/httpd/trunk/server/apreq_parser_multipart.c
Author: ylavic
Date: Fri Nov 12 21:47:09 2021
New Revision: 1894986
URL: http://svn.apache.org/viewvc?rev=1894986&view=rev
Log:
apreq: Sync r1894983 from libapreq.
Modified:
httpd/httpd/trunk/server/apreq_parser_multipart.c
Modified: httpd/httpd/trunk/server/apreq_parser_multipart.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/apreq_parser_multipart.c?rev=1894986&r1=1894985&r2=1894986&view=diff
==============================================================================
--- httpd/httpd/trunk/server/apreq_parser_multipart.c (original)
+++ httpd/httpd/trunk/server/apreq_parser_multipart.c Fri Nov 12 21:47:09 2021
@@ -220,17 +220,24 @@ struct mfd_ctx * create_multipart_contex
{
apr_status_t s;
apr_size_t blen;
- struct mfd_ctx *ctx = apr_palloc(pool, sizeof *ctx);
- char *ct = apr_pstrdup(pool, content_type);
+ struct mfd_ctx *ctx;
+ const char *attr;
+ char *buf;
- ct = strchr(ct, ';');
- if (ct == NULL)
+ attr = (content_type) ? strchr(content_type, ';') : NULL;
+ if (!attr)
return NULL; /* missing semicolon */
- *ct++ = 0;
- s = apreq_header_attribute(ct, "boundary", 8,
- (const char **)&ctx->bdry, &blen);
+ ctx = apr_palloc(pool, sizeof *ctx);
+
+ attr++;
+ blen = strlen(attr) + 1;
+ buf = apr_palloc(pool, 4 + blen);
+ buf += 4;
+ memcpy(buf, attr, blen);
+ s = apreq_header_attribute(buf, "boundary", 8,
+ (const char **)&ctx->bdry, &blen);
if (s != APR_SUCCESS)
return NULL; /* missing boundary */