summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2001-06-29 07:55:41 +0000
committerTim Potter <tpot@samba.org>2001-06-29 07:55:41 +0000
commit00ecce9630680d21effdef11fbd6afbe0eab8196 (patch)
tree0e74f0e6b482b8a4cbad834df95dd6f6220b433d
parentf83f2cd4fa3a610a92b17ac8006390cdd1f7ca94 (diff)
downloadsamba-00ecce9630680d21effdef11fbd6afbe0eab8196.tar.gz
samba-00ecce9630680d21effdef11fbd6afbe0eab8196.tar.bz2
samba-00ecce9630680d21effdef11fbd6afbe0eab8196.zip
Removed another silly static array.
(This used to be commit 008628fb8ac9f92d984218f37fffdfa3cb9e3d62)
-rw-r--r--source3/include/rpc_samr.h4
-rw-r--r--source3/rpc_parse/parse_samr.c21
2 files changed, 18 insertions, 7 deletions
diff --git a/source3/include/rpc_samr.h b/source3/include/rpc_samr.h
index cfe856b07f..20a4f5b8a0 100644
--- a/source3/include/rpc_samr.h
+++ b/source3/include/rpc_samr.h
@@ -786,8 +786,8 @@ typedef struct samr_str_entry_info1
typedef struct sam_entry_info_1
{
- SAM_ENTRY1 sam[MAX_SAM_ENTRIES];
- SAM_STR1 str[MAX_SAM_ENTRIES];
+ SAM_ENTRY1 *sam;
+ SAM_STR1 *str;
} SAM_DISPINFO_1;
diff --git a/source3/rpc_parse/parse_samr.c b/source3/rpc_parse/parse_samr.c
index 395931edd9..c4fd679003 100644
--- a/source3/rpc_parse/parse_samr.c
+++ b/source3/rpc_parse/parse_samr.c
@@ -23,7 +23,6 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-
#include "includes.h"
#include "rpc_parse.h"
#include "nterr.h"
@@ -1435,16 +1434,28 @@ static BOOL sam_io_sam_dispinfo_1(char *desc, SAM_DISPINFO_1 * sam,
{
uint32 i;
- if (sam == NULL)
- return False;
-
prs_debug(ps, depth, desc, "sam_io_sam_dispinfo_1");
depth++;
if(!prs_align(ps))
return False;
- SMB_ASSERT_ARRAY(sam->sam, num_entries);
+ if (UNMARSHALLING(ps) && num_entries > 0) {
+
+ if ((sam->sam = (SAM_ENTRY1 *)
+ prs_alloc_mem(ps, sizeof(SAM_ENTRY1) *
+ num_entries)) == NULL) {
+ DEBUG(0, ("out of memory allocating SAM_ENTRY1\n"));
+ return False;
+ }
+
+ if ((sam->str = (SAM_STR1 *)
+ prs_alloc_mem(ps, sizeof(SAM_STR1) *
+ num_entries)) == NULL) {
+ DEBUG(0, ("out of memory allocating SAM_STR1\n"));
+ return False;
+ }
+ }
for (i = 0; i < num_entries; i++) {
if(!sam_io_sam_entry1("", &sam->sam[i], ps, depth))