rpcrt4: Fix crash in rpcrt4_ncalrpc_parse_top_of_tower due to unconditionally dereferencing networkaddr and endpoint variables.

These can be NULL when parts of the tower are not required.
This commit is contained in:
Rob Shearman 2008-08-10 18:23:40 +01:00 committed by Alexandre Julliard
parent 54e904e780
commit 498216fc11
1 changed files with 3 additions and 3 deletions

View File

@ -706,9 +706,6 @@ static RPC_STATUS rpcrt4_ncalrpc_parse_top_of_tower(const unsigned char *tower_d
TRACE("(%p, %d, %p, %p)\n", tower_data, (int)tower_size, networkaddr, endpoint);
*networkaddr = NULL;
*endpoint = NULL;
if (tower_size < sizeof(*pipe_floor))
return EPT_S_NOT_REGISTERED;
@ -720,6 +717,9 @@ static RPC_STATUS rpcrt4_ncalrpc_parse_top_of_tower(const unsigned char *tower_d
(pipe_floor->count_rhs > tower_size))
return EPT_S_NOT_REGISTERED;
if (networkaddr)
*networkaddr = NULL;
if (endpoint)
{
*endpoint = I_RpcAllocate(pipe_floor->count_rhs);