summaryrefslogtreecommitdiff
path: root/source3/rpc_parse
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-07-06 17:40:16 +0000
committerJeremy Allison <jra@samba.org>2001-07-06 17:40:16 +0000
commitdf68e652d6411f11d9cb00aefb15c8a62ef1f149 (patch)
treefee02fb1a15e021295bf3c5af3a2670eb743d693 /source3/rpc_parse
parent6bd8340781a2a0c7fee711d8448e421001beddde (diff)
downloadsamba-df68e652d6411f11d9cb00aefb15c8a62ef1f149.tar.gz
samba-df68e652d6411f11d9cb00aefb15c8a62ef1f149.tar.bz2
samba-df68e652d6411f11d9cb00aefb15c8a62ef1f149.zip
Added JF's fix for max_entries being 0.
Jeremy. (This used to be commit 5059fbbb76ffa24658a878080a36e355df4894f5)
Diffstat (limited to 'source3/rpc_parse')
-rw-r--r--source3/rpc_parse/parse_samr.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/source3/rpc_parse/parse_samr.c b/source3/rpc_parse/parse_samr.c
index ec5af24d6a..a7d758ea1b 100644
--- a/source3/rpc_parse/parse_samr.c
+++ b/source3/rpc_parse/parse_samr.c
@@ -1403,6 +1403,9 @@ uint32 init_sam_dispinfo_1(TALLOC_CTX *ctx, SAM_DISPINFO_1 *sam, uint32 *num_ent
DEBUG(5, ("init_sam_dispinfo_1: max_entries: %d max_dsize: 0x%x\n",
max_entries, max_data_size));
+ if (max_entries==0)
+ return NT_STATUS_NO_PROBLEMO;
+
sam->sam=(SAM_ENTRY1 *)talloc(ctx, max_entries*sizeof(SAM_ENTRY1));
if (!sam->sam)
return NT_STATUS_NO_MEMORY;
@@ -1511,6 +1514,9 @@ uint32 init_sam_dispinfo_2(TALLOC_CTX *ctx, SAM_DISPINFO_2 *sam, uint32 *num_ent
max_entries = *num_entries;
max_data_size = *data_size;
+ if (max_entries==0)
+ return NT_STATUS_NO_PROBLEMO;
+
if (!(sam->sam=(SAM_ENTRY2 *)talloc(ctx, max_entries*sizeof(SAM_ENTRY2))))
return NT_STATUS_NO_MEMORY;
@@ -1615,6 +1621,9 @@ uint32 init_sam_dispinfo_3(TALLOC_CTX *ctx, SAM_DISPINFO_3 *sam, uint32 *num_ent
max_entries = *num_entries;
max_data_size = *data_size;
+ if (max_entries==0)
+ return NT_STATUS_NO_PROBLEMO;
+
if (!(sam->sam=(SAM_ENTRY3 *)talloc(ctx, max_entries*sizeof(SAM_ENTRY3))))
return NT_STATUS_NO_MEMORY;
@@ -1716,6 +1725,9 @@ uint32 init_sam_dispinfo_4(TALLOC_CTX *ctx, SAM_DISPINFO_4 *sam, uint32 *num_ent
max_entries = *num_entries;
max_data_size = *data_size;
+ if (max_entries==0)
+ return NT_STATUS_NO_PROBLEMO;
+
if (!(sam->sam=(SAM_ENTRY4 *)talloc(ctx, max_entries*sizeof(SAM_ENTRY4))))
return NT_STATUS_NO_MEMORY;
@@ -1815,6 +1827,9 @@ uint32 init_sam_dispinfo_5(TALLOC_CTX *ctx, SAM_DISPINFO_5 *sam, uint32 *num_ent
max_entries = *num_entries;
max_data_size = *data_size;
+ if (max_entries==0)
+ return NT_STATUS_NO_PROBLEMO;
+
if (!(sam->sam=(SAM_ENTRY5 *)talloc(ctx, max_entries*sizeof(SAM_ENTRY5))))
return NT_STATUS_NO_MEMORY;