Blame SOURCES/0001-library-add-missing-strdup.patch

341f9a
From a64cce9830c2e9c26e120f671b247ee71b45c888 Mon Sep 17 00:00:00 2001
341f9a
From: Sumit Bose <sbose@redhat.com>
341f9a
Date: Fri, 12 Apr 2019 17:31:41 +0200
341f9a
Subject: [PATCH] library: add missing strdup
341f9a
341f9a
In add_server_side_service_principals _adcli_strv_add_unique is called
341f9a
which only adds a string to a list without copying to. Since the
341f9a
original list will be freed later the value must be copied.
341f9a
341f9a
This issue was introduce with 972f1a2f35829ed89f5353bd204683aa9ad6a2d2
341f9a
and hence
341f9a
341f9a
Related to https://bugzilla.redhat.com/show_bug.cgi?id=1630187
341f9a
---
341f9a
 library/adenroll.c | 3 ++-
341f9a
 1 file changed, 2 insertions(+), 1 deletion(-)
341f9a
341f9a
diff --git a/library/adenroll.c b/library/adenroll.c
341f9a
index 1cce86a..52aa8a8 100644
341f9a
--- a/library/adenroll.c
341f9a
+++ b/library/adenroll.c
341f9a
@@ -1987,7 +1987,8 @@ add_server_side_service_principals (adcli_enroll *enroll)
341f9a
 		_adcli_info ("Checking %s", spn_list[c]);
341f9a
 		if (!_adcli_strv_has_ex (enroll->service_principals_to_remove, spn_list[c], strcasecmp)) {
341f9a
 			enroll->service_principals = _adcli_strv_add_unique (enroll->service_principals,
341f9a
-		                                                             spn_list[c], &length, false);
341f9a
+			                                                     strdup (spn_list[c]),
341f9a
+			                                                     &length, false);
341f9a
 			assert (enroll->service_principals != NULL);
341f9a
 			_adcli_info ("   Added %s", spn_list[c]);
341f9a
 		}
341f9a
-- 
341f9a
2.20.1
341f9a