rpcrt4: Return a fault packet if the proc num exceeds the index of the last function available for the interface.

This commit is contained in:
Rob Shearman 2007-07-05 12:56:35 +01:00 committed by Alexandre Julliard
parent 234b8cbe0a
commit 69eeb8b1b7
1 changed files with 6 additions and 2 deletions

View File

@ -260,8 +260,12 @@ static void RPCRT4_process_packet(RpcConnection* conn, RpcPktHdr* hdr, RPC_MESSA
func = *sif->If->DispatchTable->DispatchTable;
} else {
if (msg->ProcNum >= sif->If->DispatchTable->DispatchTableCount) {
ERR("invalid procnum\n");
func = NULL;
WARN("invalid procnum (%d/%d)\n", msg->ProcNum, sif->If->DispatchTable->DispatchTableCount);
response = RPCRT4_BuildFaultHeader(NDR_LOCAL_DATA_REPRESENTATION,
NCA_S_OP_RNG_ERROR);
RPCRT4_Send(conn, response, NULL, 0);
RPCRT4_FreeHeader(response);
}
func = sif->If->DispatchTable->DispatchTable[msg->ProcNum];
}