From 9dd7c381132be80341bb8f55ae23408b094eb792 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Mon, 13 Aug 2018 16:53:43 +0200 Subject: [PATCH] smb2: skip rest of READ response if status is not success --- rust/src/smb/smb2.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/rust/src/smb/smb2.rs b/rust/src/smb/smb2.rs index fd843c88cf..67d0d970da 100644 --- a/rust/src/smb/smb2.rs +++ b/rust/src/smb/smb2.rs @@ -116,12 +116,14 @@ pub fn smb2_read_response_record<'b>(state: &mut SMBState, r: &Smb2Record<'b>) { smb2_read_response_record_generic(state, r); - if r.nt_status != SMB_NTSTATUS_SUCCESS { - return; - } - match parse_smb2_response_read(r.data) { IResult::Done(_, rd) => { + if r.nt_status != SMB_NTSTATUS_SUCCESS { + SCLogDebug!("SMBv2: read response error code received: skip record"); + state.set_skip(STREAM_TOCLIENT, rd.len, rd.data.len() as u32); + return; + } + SCLogDebug!("SMBv2: read response => {:?}", rd); // get the request info. If we don't have it, there is nothing