From 3be7907fd91749f228bf5f104ab0c673be3fef05 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 25 Sep 2013 23:25:12 +0200 Subject: [PATCH] CVE-2013-4408:s4:dcerpc_smb: check for invalid frag_len in send_read_request_continue() Bug: https://bugzilla.samba.org/show_bug.cgi?id=10185 Signed-off-by: Stefan Metzmacher Reviewed-by: Jeremy Allison --- source4/librpc/rpc/dcerpc_smb.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source4/librpc/rpc/dcerpc_smb.c b/source4/librpc/rpc/dcerpc_smb.c index a9903e5f920..036aa89bff3 100644 --- a/source4/librpc/rpc/dcerpc_smb.c +++ b/source4/librpc/rpc/dcerpc_smb.c @@ -163,6 +163,12 @@ static NTSTATUS send_read_request_continue(struct dcecli_connection *c, DATA_BLO } else { uint32_t frag_length = blob->length>=16? dcerpc_get_frag_length(blob):0x2000; + + if (frag_length < state->data.length) { + talloc_free(state); + return NT_STATUS_RPC_PROTOCOL_ERROR; + } + state->received = blob->length; state->data = data_blob_talloc(state, NULL, frag_length); if (!state->data.data) { -- 2.34.1