From: Stefan Metzmacher Date: Fri, 10 Jul 2015 12:48:38 +0000 (+0200) Subject: CVE-2015-5370: s3:rpc_client: protect rpc_api_pipe_got_pdu() against too large payloads X-Git-Tag: samba-4.2.10~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=98182969e761429e577064e1a0fd5cbc6b50d7d9;p=thirdparty%2Fsamba.git CVE-2015-5370: s3:rpc_client: protect rpc_api_pipe_got_pdu() against too large payloads BUG: https://bugzilla.samba.org/show_bug.cgi?id=11344 Signed-off-by: Stefan Metzmacher Reviewed-by: Günther Deschner --- diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c index 02d9442b282..63ab5072edb 100644 --- a/source3/rpc_client/cli_pipe.c +++ b/source3/rpc_client/cli_pipe.c @@ -990,6 +990,11 @@ static void rpc_api_pipe_got_pdu(struct tevent_req *subreq) return; } + if (state->reply_pdu_offset + rdata.length > MAX_RPC_DATA_SIZE) { + tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER); + return; + } + /* Now copy the data portion out of the pdu into rbuf. */ if (state->reply_pdu.length < state->reply_pdu_offset + rdata.length) { if (!data_blob_realloc(NULL, &state->reply_pdu,