From a7bcf274ccf3dd6eca86c5fbdf2d568690e0c494 Mon Sep 17 00:00:00 2001 From: Patrick Monnerat Date: Wed, 20 Sep 2017 14:06:47 +0100 Subject: [PATCH] mime: rephrase the multipart output state machine (#1898) ... ... in hope coverity will like it much. --- lib/mime.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/mime.c b/lib/mime.c index 4eeb8375d..03ccfc200 100644 --- a/lib/mime.c +++ b/lib/mime.c @@ -972,11 +972,14 @@ static size_t mime_subparts_read(char *buffer, size_t size, size_t nitems, convbuf = buffer; } #endif - mimesetstate(&mime->state, - part? MIMESTATE_CONTENT: MIMESTATE_END, part); + mimesetstate(&mime->state, MIMESTATE_CONTENT, part); } break; case MIMESTATE_CONTENT: + if(!part) { + mimesetstate(&mime->state, MIMESTATE_END, NULL); + break; + } sz = readback_part(part, buffer, nitems); switch(sz) { case CURL_READFUNC_ABORT: