summaryrefslogtreecommitdiff
path: root/source3/rpc_parse/parse_net.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-04-27 23:18:41 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:19:44 -0500
commit12ba88574bf91bdcc4447bfc3d429b799064bfd9 (patch)
tree17f9b68292eb277da8c71871f8cad332c43d3a5a /source3/rpc_parse/parse_net.c
parentfdc0b87083496ae9d6d9d3d1d1a71dddaca24da2 (diff)
downloadsamba-12ba88574bf91bdcc4447bfc3d429b799064bfd9.tar.gz
samba-12ba88574bf91bdcc4447bfc3d429b799064bfd9.tar.bz2
samba-12ba88574bf91bdcc4447bfc3d429b799064bfd9.zip
r22542: Move over to using the _strict varients of the talloc
calls. No functional changes. Looks bigger than it is :-). Jeremy. (This used to be commit f6fa3080fee1b20df9f1968500840a88cf0ee592)
Diffstat (limited to 'source3/rpc_parse/parse_net.c')
-rw-r--r--source3/rpc_parse/parse_net.c28
1 files changed, 25 insertions, 3 deletions
diff --git a/source3/rpc_parse/parse_net.c b/source3/rpc_parse/parse_net.c
index 3eb31ad55f..b3331c8369 100644
--- a/source3/rpc_parse/parse_net.c
+++ b/source3/rpc_parse/parse_net.c
@@ -2995,7 +2995,16 @@ static BOOL net_io_sam_privs_info(const char *desc, SAM_DELTA_PRIVS *info,
if(!prs_uint32("attribute_count", ps, depth, &info->attribute_count))
return False;
- info->attributes = TALLOC_ARRAY(ps->mem_ctx, uint32, info->attribute_count);
+ if (UNMARSHALLING(ps)) {
+ if (info->attribute_count) {
+ info->attributes = TALLOC_ARRAY(ps->mem_ctx, uint32, info->attribute_count);
+ if (!info->attributes) {
+ return False;
+ }
+ } else {
+ info->attributes = NULL;
+ }
+ }
for (i=0; i<info->attribute_count; i++)
if(!prs_uint32("attributes", ps, depth, &info->attributes[i]))
@@ -3004,8 +3013,21 @@ static BOOL net_io_sam_privs_info(const char *desc, SAM_DELTA_PRIVS *info,
if(!prs_uint32("privlist_count", ps, depth, &info->privlist_count))
return False;
- info->hdr_privslist = TALLOC_ARRAY(ps->mem_ctx, UNIHDR, info->privlist_count);
- info->uni_privslist = TALLOC_ARRAY(ps->mem_ctx, UNISTR2, info->privlist_count);
+ if (UNMARSHALLING(ps)) {
+ if (info->privlist_count) {
+ info->hdr_privslist = TALLOC_ARRAY(ps->mem_ctx, UNIHDR, info->privlist_count);
+ info->uni_privslist = TALLOC_ARRAY(ps->mem_ctx, UNISTR2, info->privlist_count);
+ if (!info->hdr_privslist) {
+ return False;
+ }
+ if (!info->uni_privslist) {
+ return False;
+ }
+ } else {
+ info->hdr_privslist = NULL;
+ info->uni_privslist = NULL;
+ }
+ }
for (i=0; i<info->privlist_count; i++)
if(!smb_io_unihdr("hdr_privslist", &info->hdr_privslist[i], ps, depth))