1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-22 08:08:50 -05:00

mime: fix an explicit null dereference (#1899)

This commit is contained in:
Patrick Monnerat 2017-09-20 12:01:11 +01:00
parent 299896ca09
commit f304201868

View File

@ -1604,7 +1604,7 @@ CURLcode Curl_mime_prepare_headers(curl_mimepart *part,
/* Be sure we won't access old headers later. */ /* Be sure we won't access old headers later. */
if(part->state.state == MIMESTATE_CURLHEADERS) if(part->state.state == MIMESTATE_CURLHEADERS)
mimesetstate(&mime->state, MIMESTATE_CURLHEADERS, NULL); mimesetstate(&part->state, MIMESTATE_CURLHEADERS, NULL);
/* Build the content-type header. */ /* Build the content-type header. */
s = search_header(part->userheaders, "Content-Type"); s = search_header(part->userheaders, "Content-Type");
@ -1704,7 +1704,7 @@ CURLcode Curl_mime_prepare_headers(curl_mimepart *part,
/* If we were reading curl-generated headers, restart with new ones (this /* If we were reading curl-generated headers, restart with new ones (this
should not occur). */ should not occur). */
if(part->state.state == MIMESTATE_CURLHEADERS) if(part->state.state == MIMESTATE_CURLHEADERS)
mimesetstate(&mime->state, MIMESTATE_CURLHEADERS, part->curlheaders); mimesetstate(&part->state, MIMESTATE_CURLHEADERS, part->curlheaders);
/* Process subparts. */ /* Process subparts. */
if(part->kind == MIMEKIND_MULTIPART && mime) { if(part->kind == MIMEKIND_MULTIPART && mime) {