1
0
mirror of https://github.com/apache/httpd.git synced 2025-11-17 00:03:29 +03:00

apreq: Sync r1894983 from libapreq.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1894986 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yann Ylavic
2021-11-12 21:47:09 +00:00
parent beec41a39a
commit 6c44dd11d5

View File

@@ -220,17 +220,24 @@ struct mfd_ctx * create_multipart_context(const char *content_type,
{
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 */