aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/curl/lib/mime.c
diff options
context:
space:
mode:
authorshadchin <shadchin@yandex-team.ru>2022-04-13 20:13:40 +0300
committershadchin <shadchin@yandex-team.ru>2022-04-13 20:13:40 +0300
commitad92d4ea3ed939dee26114e765dc7e60eb99349e (patch)
treec9f920ed0d65fca79b89e5e1504808d7b265d49b /contrib/libs/curl/lib/mime.c
parentf9c8ebd5329f4efcc759fde08d0540f55d9f7acc (diff)
downloadydb-ad92d4ea3ed939dee26114e765dc7e60eb99349e.tar.gz
CONTRIB-2513 Update contrib/libs/curl to 7.80.0
ref:9f073731f38021df100328c1b343280bf6632e23
Diffstat (limited to 'contrib/libs/curl/lib/mime.c')
-rw-r--r--contrib/libs/curl/lib/mime.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/contrib/libs/curl/lib/mime.c b/contrib/libs/curl/lib/mime.c
index 0bf1b46a4c..f40cc1a618 100644
--- a/contrib/libs/curl/lib/mime.c
+++ b/contrib/libs/curl/lib/mime.c
@@ -462,11 +462,13 @@ static size_t encoder_base64_read(char *buffer, size_t size, bool ateof,
/* Buffered data size can only be 0, 1 or 2. */
ptr[2] = ptr[3] = '=';
i = 0;
- switch(st->bufend - st->bufbeg) {
- case 2:
- i = (st->buf[st->bufbeg + 1] & 0xFF) << 8;
- /* FALLTHROUGH */
- case 1:
+
+ /* If there is buffered data */
+ if(st->bufend != st->bufbeg) {
+
+ if(st->bufend - st->bufbeg == 2)
+ i = (st->buf[st->bufbeg + 1] & 0xFF) << 8;
+
i |= (st->buf[st->bufbeg] & 0xFF) << 16;
ptr[0] = base64[(i >> 18) & 0x3F];
ptr[1] = base64[(i >> 12) & 0x3F];
@@ -476,7 +478,6 @@ static size_t encoder_base64_read(char *buffer, size_t size, bool ateof,
}
cursize += 4;
st->pos += 4;
- break;
}
}
}
@@ -1954,7 +1955,8 @@ void Curl_mime_unpause(curl_mimepart *part)
}
-#else /* !CURL_DISABLE_HTTP || !CURL_DISABLE_SMTP || !CURL_DISABLE_IMAP */
+#else /* !CURL_DISABLE_HTTP && !CURL_DISABLE_MIME ||
+ !CURL_DISABLE_SMTP || !CURL_DISABLE_IMAP */
/* Mime not compiled in: define stubs for externally-referenced functions. */
curl_mime *curl_mime_init(CURL *easy)