From 13928e470d583b43cdff970ca2a0ccf564dce6cc Mon Sep 17 00:00:00 2001 From: "Steffen (Daode) Nurpmeso" Date: Thu, 3 Aug 2017 19:27:28 +0200 Subject: [PATCH] mime_write(): [CID 1379027] --- mime.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mime.c b/mime.c index 3491112e..5a4d5c0d 100644 --- a/mime.c +++ b/mime.c @@ -1311,7 +1311,7 @@ jqpb64_dec: * TODO in the same relaxed fashion like completely bogus bytes by at * TODO least mutt and OpenSSL. So we need an expensive workaround * TODO unless we have input->iconv->base64 filter chain as such!! :( */ - if(size != 0){ + if(size != 0 && /* for Coverity, else assert() */ inrest != NULL){ if(in.l > B64_ENCODE_INPUT_PER_LINE){ size_t i; @@ -1319,14 +1319,12 @@ jqpb64_dec: in.l -= i; if(i != 0){ - assert(inrest != NULL); assert(inrest->l == 0); inrest->s = n_realloc(inrest->s, i +1); memcpy(inrest->s, &in.s[in.l], i); inrest->s[inrest->l = i] = '\0'; } }else if(in.l < B64_ENCODE_INPUT_PER_LINE){ - assert(inrest != NULL); inrest->s = n_realloc(inrest->s, in.l +1); memcpy(inrest->s, in.s, in.l); inrest->s[inrest->l = in.l] = '\0'; -- 2.11.4.GIT