From bc2a6ae58635baf3a2faf3e799b607e816a8165a Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Mon, 12 Jun 2023 19:33:12 +0200 Subject: [PATCH] Fix 'CVE-2017-1000257' Merge: curl/curl@13c9a9ded3ae744a1e11cbc14e9146d9fa427040 --- r5dev/thirdparty/curl/imap.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/r5dev/thirdparty/curl/imap.c b/r5dev/thirdparty/curl/imap.c index b528f77d..aa505460 100644 --- a/r5dev/thirdparty/curl/imap.c +++ b/r5dev/thirdparty/curl/imap.c @@ -1141,6 +1141,12 @@ static CURLcode imap_state_fetch_resp(struct connectdata *conn, int imapcode, /* The conversion from curl_off_t to size_t is always fine here */ chunk = (size_t)size; + if (!chunk) { + /* no size, we're done with the data */ + state(conn, IMAP_STOP); + return CURLE_OK; + } + result = Curl_client_write(conn, CLIENTWRITE_BODY, pp->cache, chunk); if(result) return result;