Blame SOURCES/0007-curl-7.76.1-CVE-2021-22945.patch

d889a8
From bb7619897e53ed424e0712ca5a4c93d5fae99715 Mon Sep 17 00:00:00 2001
d889a8
From: z2_ on hackerone <>
d889a8
Date: Tue, 24 Aug 2021 09:50:33 +0200
d889a8
Subject: [PATCH] mqtt: clear the leftovers pointer when sending succeeds
d889a8
d889a8
CVE-2021-22945
d889a8
d889a8
Bug: https://curl.se/docs/CVE-2021-22945.html
d889a8
d889a8
Upstream-commit: 43157490a5054bd24256fe12876931e8abc9df49
d889a8
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
d889a8
---
d889a8
 lib/mqtt.c | 4 ++++
d889a8
 1 file changed, 4 insertions(+)
d889a8
d889a8
diff --git a/lib/mqtt.c b/lib/mqtt.c
d889a8
index d88fa73..f3fc045 100644
d889a8
--- a/lib/mqtt.c
d889a8
+++ b/lib/mqtt.c
d889a8
@@ -128,6 +128,10 @@ static CURLcode mqtt_send(struct Curl_easy *data,
d889a8
     mq->sendleftovers = sendleftovers;
d889a8
     mq->nsend = nsend;
d889a8
   }
d889a8
+  else {
d889a8
+    mq->sendleftovers = NULL;
d889a8
+    mq->nsend = 0;
d889a8
+  }
d889a8
   return result;
d889a8
 }
d889a8
 
d889a8
-- 
d889a8
2.31.1
d889a8