Blame SOURCES/0002-adaptive-Fix-use-after-free.patch

14acf4
From a10d4ddeb8b55e238289d63a2623b8936eb6bda4 Mon Sep 17 00:00:00 2001
14acf4
From: Benjamin Berg <bberg@redhat.com>
14acf4
Date: Thu, 10 Dec 2020 11:36:43 +0100
14acf4
Subject: [PATCH 2/3] adaptive: Fix use-after-free
14acf4
14acf4
The debug logging would access a recently free'ed variable. Fix this by
14acf4
changing the order.
14acf4
---
14acf4
 src/thd_engine_adaptive.cpp | 3 ++-
14acf4
 1 file changed, 2 insertions(+), 1 deletion(-)
14acf4
14acf4
diff --git a/src/thd_engine_adaptive.cpp b/src/thd_engine_adaptive.cpp
14acf4
index 4824a9d..b68cc40 100644
14acf4
--- a/src/thd_engine_adaptive.cpp
14acf4
+++ b/src/thd_engine_adaptive.cpp
14acf4
@@ -692,10 +692,11 @@ int cthd_engine_adaptive::parse_gddv_key(char *buf, int size, int *end_offset) {
14acf4
 
14acf4
 	str = strtok(key, "/");
14acf4
 	if (!str) {
14acf4
+		thd_log_debug("Ignoring key %s\n", key);
14acf4
+
14acf4
 		delete[] (key);
14acf4
 		delete[] (val);
14acf4
 
14acf4
-		thd_log_debug("Ignoring key %s\n", key);
14acf4
 		/* Ignore */
14acf4
 		return THD_SUCCESS;
14acf4
 	}
14acf4
-- 
14acf4
2.26.2
14acf4