summaryrefslogtreecommitdiff
path: root/source3/rpc_parse/parse_misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/rpc_parse/parse_misc.c')
-rw-r--r--source3/rpc_parse/parse_misc.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/source3/rpc_parse/parse_misc.c b/source3/rpc_parse/parse_misc.c
index 859a800771..0a2f49d4dd 100644
--- a/source3/rpc_parse/parse_misc.c
+++ b/source3/rpc_parse/parse_misc.c
@@ -647,17 +647,14 @@ BOOL smb_io_buffer5(char *desc, BUFFER5 *buf5, prs_struct *ps, int depth)
if (buf5 == NULL) return False;
- prs_align(ps);
- prs_uint32("buf_len", ps, depth, &(buf5->buf_len));
+ if(!prs_align(ps))
+ return False;
+ if(!prs_uint32("buf_len", ps, depth, &buf5->buf_len))
+ return False;
- /* reading: alloc the buffer first */
- if ( UNMARSHALLING(ps) ) {
- buf5->buffer=(uint16 *)prs_alloc_mem(ps, sizeof(uint16)*buf5->buf_len );
- if (buf5->buffer == NULL)
- return False;
- }
-
- prs_uint16s(True, "buffer", ps, depth, buf5->buffer, buf5->buf_len);
+
+ if(!prs_buffer5(True, "buffer" , ps, depth, buf5))
+ return False;
return True;
}