diff options
author | Günther Deschner <gd@samba.org> | 2010-06-11 15:05:36 +0200 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2010-06-11 15:11:31 +0200 |
commit | 4bb351ac8080c92ff6a84a5cdeca0b158864da1b (patch) | |
tree | 2a3866c603f9fbdd23ea51bf2f62cd109a0cf79a /source3 | |
parent | a9b06f58f254e659ccf253af0d8fb7f062e03188 (diff) | |
download | samba-4bb351ac8080c92ff6a84a5cdeca0b158864da1b.tar.gz samba-4bb351ac8080c92ff6a84a5cdeca0b158864da1b.tar.bz2 samba-4bb351ac8080c92ff6a84a5cdeca0b158864da1b.zip |
s3-auth: Fix valgrind warning (unitialized var) in samu_to_SamInfo3().
Guenther
s3:auth do not fail if there are 0 group sids
Signed-off-by: Günther Deschner <gd@samba.org>
Diffstat (limited to 'source3')
-rw-r--r-- | source3/auth/server_info.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/source3/auth/server_info.c b/source3/auth/server_info.c index 1ef272489c..a43c4f931a 100644 --- a/source3/auth/server_info.c +++ b/source3/auth/server_info.c @@ -308,7 +308,7 @@ NTSTATUS samu_to_SamInfo3(TALLOC_CTX *mem_ctx, const struct dom_sid *group_sid; struct dom_sid domain_sid; struct dom_sid *group_sids; - size_t num_group_sids; + size_t num_group_sids = 0; const char *tmp; gid_t *gids; NTSTATUS status; @@ -441,10 +441,12 @@ NTSTATUS samu_to_SamInfo3(TALLOC_CTX *mem_ctx, return status; } - status = group_sids_to_info3(info3, group_sids, num_group_sids); - if (!NT_STATUS_IS_OK(status)) { - TALLOC_FREE(info3); - return status; + if (num_group_sids) { + status = group_sids_to_info3(info3, group_sids, num_group_sids); + if (!NT_STATUS_IS_OK(status)) { + TALLOC_FREE(info3); + return status; + } } /* We don't need sids and gids after the conversion */ |