diff options
author | Marc VanHeyningen <marc.vanheyningen@isilon.com> | 2009-05-05 22:07:40 +0000 |
---|---|---|
committer | Tim Prouty <tprouty@samba.org> | 2009-05-27 12:37:35 -0700 |
commit | 75de7c0e87cc5ecea1a7d7e9b0103a8cc2827895 (patch) | |
tree | 977348a844f366f50f26398b18765a9e36ad9b95 /source3/passdb | |
parent | 3fe9859342c28fe9da7011fb18a5fb5de8b29fa6 (diff) | |
download | samba-75de7c0e87cc5ecea1a7d7e9b0103a8cc2827895.tar.gz samba-75de7c0e87cc5ecea1a7d7e9b0103a8cc2827895.tar.bz2 samba-75de7c0e87cc5ecea1a7d7e9b0103a8cc2827895.zip |
s3: zero an uninitialized array
Invalid pointers were being dereferenced in lookup_sids causing
occasional seg faults.
Signed-off-by: Tim Prouty <tprouty@samba.org>
Diffstat (limited to 'source3/passdb')
-rw-r--r-- | source3/passdb/lookup_sid.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source3/passdb/lookup_sid.c b/source3/passdb/lookup_sid.c index b45000e77e..3a03cfe081 100644 --- a/source3/passdb/lookup_sid.c +++ b/source3/passdb/lookup_sid.c @@ -468,12 +468,15 @@ static bool lookup_rids(TALLOC_CTX *mem_ctx, const DOM_SID *domain_sid, sid_string_dbg(domain_sid))); if (num_rids) { - *names = TALLOC_ARRAY(mem_ctx, const char *, num_rids); + *names = TALLOC_ZERO_ARRAY(mem_ctx, const char *, num_rids); *types = TALLOC_ARRAY(mem_ctx, enum lsa_SidType, num_rids); if ((*names == NULL) || (*types == NULL)) { return false; } + + for (i = 0; i < num_rids; i++) + (*types)[i] = SID_NAME_UNKNOWN; } else { *names = NULL; *types = NULL; |