summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/aparser/parser.c4
-rw-r--r--source3/aparser/parser.h1
2 files changed, 4 insertions, 1 deletions
diff --git a/source3/aparser/parser.c b/source3/aparser/parser.c
index a324f804f8..27605dcfec 100644
--- a/source3/aparser/parser.c
+++ b/source3/aparser/parser.c
@@ -46,6 +46,8 @@ BOOL prs_grow(prs_struct *ps, uint32 extra_space)
uint32 new_size;
char *new_data;
+ ps->grow_size = MAX(ps->grow_size, ps->data_offset + extra_space);
+
if(ps->data_offset + extra_space <= ps->buffer_size)
return True;
@@ -267,7 +269,7 @@ void dump_data(int level,char *buf1,int len)
********************************************************************/
BOOL prs_pointer(char *desc, prs_struct *ps, int depth, void **p)
{
- uint32 v;
+ uint32 v = (*p) ? 1 : 0;
if (!prs_uint32(desc, ps, depth, &v)) return False;
*p = (void *) (v ? 1 : 0);
return True;
diff --git a/source3/aparser/parser.h b/source3/aparser/parser.h
index 843d0c7a11..353a879cb7 100644
--- a/source3/aparser/parser.h
+++ b/source3/aparser/parser.h
@@ -48,6 +48,7 @@ typedef struct _prs_struct
BOOL is_dynamic; /* Do we own this memory or not ? */
uint32 data_offset; /* Current working offset into data. */
uint32 buffer_size; /* Current size of the buffer. */
+ uint32 grow_size; /* size requested via prs_grow() calls */
char *data_p; /* The buffer itself. */
} prs_struct;