summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2013-11-07 12:00:43 +0100
committerJakub Hrozek <jhrozek@redhat.com>2013-11-08 13:15:12 +0100
commit7abc9b5b1170783cbc73689a2d8169b8e4b540eb (patch)
tree6122bce1c3451b64d7e9a5d4e9edc435f5252821
parent4f9f570e1645c6c4303d8061808d3b1d28b1db88 (diff)
downloadsssd-7abc9b5b1170783cbc73689a2d8169b8e4b540eb.tar.gz
sssd-7abc9b5b1170783cbc73689a2d8169b8e4b540eb.tar.xz
sssd-7abc9b5b1170783cbc73689a2d8169b8e4b540eb.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 45e7cc657..73190faa1 100644
--- a/src/providers/ad/ad_subdomains.c
+++ b/src/providers/ad/ad_subdomains.c
@@ -104,7 +104,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;