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

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