Blame SOURCES/0147-IPA-Initialize-a-boolean-control-value.patch

9f89df
From ffe5898f9588ba4ec3258807d377a82e52c38c67 Mon Sep 17 00:00:00 2001
9f89df
From: Jakub Hrozek <jhrozek@redhat.com>
9f89df
Date: Tue, 4 Oct 2016 10:45:43 +0200
9f89df
Subject: [PATCH 147/149] IPA: Initialize a boolean control value
9f89df
MIME-Version: 1.0
9f89df
Content-Type: text/plain; charset=UTF-8
9f89df
Content-Transfer-Encoding: 8bit
9f89df
9f89df
without this patch, valgrind was reporting:
9f89df
==30955== Conditional jump or move depends on uninitialised value(s)
9f89df
==30955== at 0xDBBACC3: ipa_subdomains_slave_search_done (ipa_subdomains.c:1111)
9f89df
==30955== by 0xE73B34D: sdap_search_bases_ex_done (sdap_ops.c:222)
9f89df
==30955== by 0xE6FFA98: sdap_get_generic_done (sdap_async.c:1872)
9f89df
==30955== by 0xE6FF4E2: generic_ext_search_handler (sdap_async.c:1689)
9f89df
==30955== by 0xE6FF840: sdap_get_and_parse_generic_done (sdap_async.c:1797)
9f89df
==30955== by 0xE6FEFB5: sdap_get_generic_op_finished (sdap_async.c:1579)
9f89df
==30955== by 0xE6FB1D2: sdap_process_message (sdap_async.c:353)
9f89df
==30955== by 0xE6FAD51: sdap_process_result (sdap_async.c:197)
9f89df
==30955== by 0xE6FAA14: sdap_ldap_next_result (sdap_async.c:145)
9f89df
==30955== by 0x8E157FF: tevent_common_loop_timer_delay (tevent_timed.c:341)
9f89df
==30955== by 0x8E16809: epoll_event_loop_once (tevent_epoll.c:911)
9f89df
==30955== by 0x8E14F09: std_event_loop_once (tevent_standard.c:114)
9f89df
==30955==
9f89df
9f89df
Resolves:
9f89df
https://fedorahosted.org/sssd/ticket/3213
9f89df
9f89df
Reviewed-by: Fabiano FidĂȘncio <fidencio@redhat.com>
9f89df
---
9f89df
 src/providers/ipa/ipa_subdomains.c | 7 ++++++-
9f89df
 1 file changed, 6 insertions(+), 1 deletion(-)
9f89df
9f89df
diff --git a/src/providers/ipa/ipa_subdomains.c b/src/providers/ipa/ipa_subdomains.c
9f89df
index 4e5bceb8c761bf4476928168d620baf2beb62ad5..d02d2d5c05904c54c5e1997aece82f940b7334ee 100644
9f89df
--- a/src/providers/ipa/ipa_subdomains.c
9f89df
+++ b/src/providers/ipa/ipa_subdomains.c
9f89df
@@ -482,6 +482,11 @@ static errno_t ipa_subdomains_refresh(struct ipa_subdomains_ctx *ctx,
9f89df
     memset(handled, 0, sizeof(bool) * count);
9f89df
     h = 0;
9f89df
 
9f89df
+    if (changes == NULL) {
9f89df
+        return EINVAL;
9f89df
+    }
9f89df
+    *changes = false;
9f89df
+
9f89df
     /* check existing subdomains */
9f89df
     for (dom = get_next_domain(parent, SSS_GND_DESCEND);
9f89df
          dom && IS_SUBDOMAIN(dom); /* if we get back to a parent, stop */
9f89df
@@ -1084,7 +1089,7 @@ static void ipa_subdomains_slave_search_done(struct tevent_req *subreq)
9f89df
     struct tevent_req *req;
9f89df
     struct sysdb_attrs **reply;
9f89df
     size_t reply_count;
9f89df
-    bool has_changes;
9f89df
+    bool has_changes = false;
9f89df
     errno_t ret;
9f89df
 
9f89df
     req = tevent_req_callback_data(subreq, struct tevent_req);
9f89df
-- 
9f89df
2.7.4
9f89df