Blame SOURCES/openscap-1.3.4-bump-yamlfilter-fix-warnings-PR_1530.patch

cf6bdb
From 31f2aa5729f9d6e9c1d8c06e3b979e89ff4e8e9e Mon Sep 17 00:00:00 2001
cf6bdb
From: Evgeny Kolesnikov <ekolesni@redhat.com>
cf6bdb
Date: Tue, 19 May 2020 07:26:25 +0200
cf6bdb
Subject: [PATCH 1/3] Update yaml-filter to the latest version (fixes minor
cf6bdb
 warnings)
cf6bdb
cf6bdb
yaml-path.c:342:61: warning: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Wsign-compare]
cf6bdb
yaml-path.c:251:27: warning: unused variable 'sec' [-Wunused-variable]
cf6bdb
---
cf6bdb
 CMakeLists.txt | 4 ++--
cf6bdb
 yaml-filter    | 2 +-
cf6bdb
 2 files changed, 3 insertions(+), 3 deletions(-)
cf6bdb
cf6bdb
diff --git a/CMakeLists.txt b/CMakeLists.txt
cf6bdb
index 65d674140..8752d66c8 100644
cf6bdb
--- a/CMakeLists.txt
cf6bdb
+++ b/CMakeLists.txt
cf6bdb
@@ -545,7 +545,7 @@ include_directories(
cf6bdb
 	"src/XCCDF/public/"
cf6bdb
 	"src/XCCDF_POLICY/"
cf6bdb
 	"src/XCCDF_POLICY/public/"
cf6bdb
-	"yaml-filter"
cf6bdb
+	"yaml-filter/src/"
cf6bdb
 	${CMAKE_BINARY_DIR} # config.h is generated to build directory
cf6bdb
 	${LIBXML2_INCLUDE_DIR}
cf6bdb
 	${PCRE_INCLUDE_DIRS}
cf6bdb
@@ -570,7 +570,7 @@ function(set_oscap_generic_properties TARGET_OBJECT)
cf6bdb
 endfunction()
cf6bdb
 
cf6bdb
 if(OPENSCAP_PROBE_INDEPENDENT_YAMLFILECONTENT)
cf6bdb
-	add_library(yamlfilter_object OBJECT yaml-filter/yaml-path.c yaml-filter/yaml-path.h)
cf6bdb
+	add_library(yamlfilter_object OBJECT yaml-filter/src/yaml-path.c yaml-filter/src/yaml-path.h)
cf6bdb
 	set_oscap_generic_properties(yamlfilter_object)
cf6bdb
 endif()
cf6bdb
 
cf6bdb
cf6bdb
From 69111f40e24a44241609f485034420bac666e756 Mon Sep 17 00:00:00 2001
cf6bdb
From: Evgeny Kolesnikov <ekolesni@redhat.com>
cf6bdb
Date: Tue, 19 May 2020 07:28:53 +0200
cf6bdb
Subject: [PATCH 2/3] probes/yamlfilecontent: Properly destroy yaml_path before
cf6bdb
 bailing out
cf6bdb
cf6bdb
yamlfilecontent_probe.c:163: leaked_storage: Variable "yaml_path" going out of scope leaks the storage it points to.
cf6bdb
---
cf6bdb
 src/OVAL/probes/independent/yamlfilecontent_probe.c | 1 +
cf6bdb
 1 file changed, 1 insertion(+)
cf6bdb
cf6bdb
diff --git a/src/OVAL/probes/independent/yamlfilecontent_probe.c b/src/OVAL/probes/independent/yamlfilecontent_probe.c
cf6bdb
index 8fc4b32b2..b8a379313 100644
cf6bdb
--- a/src/OVAL/probes/independent/yamlfilecontent_probe.c
cf6bdb
+++ b/src/OVAL/probes/independent/yamlfilecontent_probe.c
cf6bdb
@@ -159,6 +159,7 @@ static int yaml_path_query(const char *filepath, const char *yaml_path_cstr, str
cf6bdb
 		probe_cobj_add_msg(probe_ctx_getresult(ctx), msg);
cf6bdb
 		SEXP_free(msg);
cf6bdb
 		probe_cobj_set_flag(probe_ctx_getresult(ctx), SYSCHAR_FLAG_ERROR);
cf6bdb
+		yaml_path_destroy(yaml_path);
cf6bdb
 		fclose(yaml_file);
cf6bdb
 		return -1;
cf6bdb
 	};