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

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