From ef34e3336b6f4a84fb0d0a121c1eb5c54165b457 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Mon, 20 Jun 2005 22:13:19 +0000 Subject: r7789: fix overparanoid assert() call when checking spolss buffer pointers (This used to be commit e81e6e653aecdd0e4cfd2ea7ced16070bc376292) --- source3/rpc_parse/parse_buffer.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/source3/rpc_parse/parse_buffer.c b/source3/rpc_parse/parse_buffer.c index a48d5cfa98..ff2a7cc2f6 100644 --- a/source3/rpc_parse/parse_buffer.c +++ b/source3/rpc_parse/parse_buffer.c @@ -173,14 +173,20 @@ BOOL rpcbuf_alloc_size(RPC_BUFFER *buffer, uint32 buffer_size) void rpcbuf_move(RPC_BUFFER *src, RPC_BUFFER **dest) { - SMB_ASSERT( src != NULL ); + if ( !src ) { + *dest = NULL; + return; + } + + prs_switch_type( &src->prs, MARSHALL ); - prs_switch_type(&src->prs, MARSHALL); - if(!prs_set_offset(&src->prs, 0)) + if ( !prs_set_offset(&src->prs, 0) ) return; - prs_force_dynamic(&src->prs); - prs_mem_clear(&src->prs); - *dest=src; + + prs_force_dynamic( &src->prs ); + prs_mem_clear( &src->prs ); + + *dest = src; } /******************************************************************* -- cgit