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