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

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