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:
parent
54e904e780
commit
498216fc11
|
@ -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);
|
TRACE("(%p, %d, %p, %p)\n", tower_data, (int)tower_size, networkaddr, endpoint);
|
||||||
|
|
||||||
*networkaddr = NULL;
|
|
||||||
*endpoint = NULL;
|
|
||||||
|
|
||||||
if (tower_size < sizeof(*pipe_floor))
|
if (tower_size < sizeof(*pipe_floor))
|
||||||
return EPT_S_NOT_REGISTERED;
|
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))
|
(pipe_floor->count_rhs > tower_size))
|
||||||
return EPT_S_NOT_REGISTERED;
|
return EPT_S_NOT_REGISTERED;
|
||||||
|
|
||||||
|
if (networkaddr)
|
||||||
|
*networkaddr = NULL;
|
||||||
|
|
||||||
if (endpoint)
|
if (endpoint)
|
||||||
{
|
{
|
||||||
*endpoint = I_RpcAllocate(pipe_floor->count_rhs);
|
*endpoint = I_RpcAllocate(pipe_floor->count_rhs);
|
||||||
|
|
Loading…
Reference in New Issue