summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2013-11-07 12:00:43 +0100
committerJakub Hrozek <jhrozek@redhat.com>2013-12-19 20:10:31 +0100
commit456d952eecf2f068feafd2fff8bec8df84eba8ca (patch)
treed617b4aac33819eb8bda535a1de2169d2bf93090
parentccb2fe6ee1397b3c3d413d6c546cb88701958de3 (diff)
downloadsssd-456d952eecf2f068feafd2fff8bec8df84eba8ca.tar.gz
sssd-456d952eecf2f068feafd2fff8bec8df84eba8ca.tar.xz
sssd-456d952eecf2f068feafd2fff8bec8df84eba8ca.zip
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.
-rw-r--r--src/providers/ad/ad_subdomains.c2
-rw-r--r--src/providers/ldap/sdap_async_initgroups_ad.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/providers/ad/ad_subdomains.c b/src/providers/ad/ad_subdomains.c
index dd692fb69..100fb13e9 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 aa72c8876..e58d93fb2 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;