diff options
author | Jeremy Allison <jra@samba.org> | 2007-05-22 20:20:01 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:22:43 -0500 |
commit | 71ee55f98d87ff70e5feb0d2b280e9c71f7b9b6a (patch) | |
tree | 873d148c4731b4d909d3bc1f50ddab49f5849182 /source3/rpc_parse/parse_net.c | |
parent | 725e90f1572be8734c321a3d638abdf778038349 (diff) | |
download | samba-71ee55f98d87ff70e5feb0d2b280e9c71f7b9b6a.tar.gz samba-71ee55f98d87ff70e5feb0d2b280e9c71f7b9b6a.tar.bz2 samba-71ee55f98d87ff70e5feb0d2b280e9c71f7b9b6a.zip |
r23080: Fix bug #4637 - we hads missed some cases where
we were calling PRS_ALLOC_MEM with zero count.
Jeremy.
(This used to be commit 9a10736e6fa276ca4b0726fbb7baf0daafbdc46d)
Diffstat (limited to 'source3/rpc_parse/parse_net.c')
-rw-r--r-- | source3/rpc_parse/parse_net.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/source3/rpc_parse/parse_net.c b/source3/rpc_parse/parse_net.c index 4c2f676831..6e2b2b26e7 100644 --- a/source3/rpc_parse/parse_net.c +++ b/source3/rpc_parse/parse_net.c @@ -1813,9 +1813,13 @@ BOOL net_io_user_info3(const char *desc, NET_USER_INFO_3 *usr, prs_struct *ps, } if (UNMARSHALLING(ps)) { - usr->gids = PRS_ALLOC_MEM(ps, DOM_GID, usr->num_groups); - if (usr->gids == NULL) - return False; + if (usr->num_groups) { + usr->gids = PRS_ALLOC_MEM(ps, DOM_GID, usr->num_groups); + if (usr->gids == NULL) + return False; + } else { + usr->gids = NULL; + } } for (i = 0; i < usr->num_groups; i++) { @@ -1848,10 +1852,15 @@ BOOL net_io_user_info3(const char *desc, NET_USER_INFO_3 *usr, prs_struct *ps, return False; if (UNMARSHALLING(ps)) { - usr->other_sids = PRS_ALLOC_MEM(ps, DOM_SID2, usr->num_other_sids); - usr->other_sids_attrib = - PRS_ALLOC_MEM(ps, uint32, usr->num_other_sids); - + if (usr->num_other_sids) { + usr->other_sids = PRS_ALLOC_MEM(ps, DOM_SID2, usr->num_other_sids); + usr->other_sids_attrib = + PRS_ALLOC_MEM(ps, uint32, usr->num_other_sids); + } else { + usr->other_sids = NULL; + usr->other_sids_attrib = NULL; + } + if ((num_other_sids != 0) && ((usr->other_sids == NULL) || (usr->other_sids_attrib == NULL))) |