Blame SOURCES/0005-curl-7.61.1-CVE-2018-16840.patch

b91d92
From 235f209a0e62edee654be441a50bb0c154edeaa5 Mon Sep 17 00:00:00 2001
b91d92
From: Daniel Stenberg <daniel@haxx.se>
b91d92
Date: Thu, 18 Oct 2018 15:07:15 +0200
b91d92
Subject: [PATCH] Curl_close: clear data->multi_easy on free to avoid
b91d92
 use-after-free
b91d92
b91d92
Regression from b46cfbc068 (7.59.0)
b91d92
CVE-2018-16840
b91d92
Reported-by: Brian Carpenter (Geeknik Labs)
b91d92
b91d92
Bug: https://curl.haxx.se/docs/CVE-2018-16840.html
b91d92
b91d92
Upstream-commit: 81d135d67155c5295b1033679c606165d4e28f3f
b91d92
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
b91d92
---
b91d92
 lib/url.c | 4 +++-
b91d92
 1 file changed, 3 insertions(+), 1 deletion(-)
b91d92
b91d92
diff --git a/lib/url.c b/lib/url.c
b91d92
index f159008..dcc1ecc 100644
b91d92
--- a/lib/url.c
b91d92
+++ b/lib/url.c
b91d92
@@ -319,10 +319,12 @@ CURLcode Curl_close(struct Curl_easy *data)
b91d92
        and detach this handle from there. */
b91d92
     curl_multi_remove_handle(data->multi, data);
b91d92
 
b91d92
-  if(data->multi_easy)
b91d92
+  if(data->multi_easy) {
b91d92
     /* when curl_easy_perform() is used, it creates its own multi handle to
b91d92
        use and this is the one */
b91d92
     curl_multi_cleanup(data->multi_easy);
b91d92
+    data->multi_easy = NULL;
b91d92
+  }
b91d92
 
b91d92
   /* Destroy the timeout list that is held in the easy handle. It is
b91d92
      /normally/ done by curl_multi_remove_handle() but this is "just in
b91d92
-- 
b91d92
2.17.2
b91d92