Blob Blame History Raw
From 456d952eecf2f068feafd2fff8bec8df84eba8ca Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <jhrozek@redhat.com>
Date: Thu, 7 Nov 2013 12:00:43 +0100
Subject: [PATCH 23/31] Initialize sid_str to NULL to avoid freeing random data

If any function before failed, sss_idmap_free_sid() might have been
called with random data.
---
 src/providers/ad/ad_subdomains.c              | 2 +-
 src/providers/ldap/sdap_async_initgroups_ad.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/providers/ad/ad_subdomains.c b/src/providers/ad/ad_subdomains.c
index dd692fb699ddf14bcf8f9926383e82da77c494e0..100fb13e99f7bf4b3946b1f5c5f9c626674bfb46 100644
--- a/src/providers/ad/ad_subdomains.c
+++ b/src/providers/ad/ad_subdomains.c
@@ -234,7 +234,7 @@ ad_subdom_store(struct ad_subdomains_ctx *ctx,
     errno_t ret;
     enum idmap_error_code err;
     struct ldb_message_element *el;
-    char *sid_str;
+    char *sid_str = NULL;
     uint32_t trust_type;
     bool mpg;
 
diff --git a/src/providers/ldap/sdap_async_initgroups_ad.c b/src/providers/ldap/sdap_async_initgroups_ad.c
index aa72c8876ba93eefc6230537801c50ab04e591ce..e58d93fb2da36febd6074381882192ba9e204e86 100644
--- a/src/providers/ldap/sdap_async_initgroups_ad.c
+++ b/src/providers/ldap/sdap_async_initgroups_ad.c
@@ -361,7 +361,7 @@ sdap_get_ad_tokengroups_initgroups_lookup_done(struct tevent_req *subreq)
     size_t user_count, group_count, i;
     TALLOC_CTX *tmp_ctx;
     bool in_transaction = false;
-    char *sid_str;
+    char *sid_str = NULL;
     gid_t gid;
     time_t now;
     struct sss_domain_info *group_domain;
-- 
1.8.4.2