From de46f4ba9dbc9aefb0baf9e5e6dbc9e619d54aad Mon Sep 17 00:00:00 2001 From: Giuseppe Longo Date: Fri, 30 Jan 2026 07:46:14 +0100 Subject: [PATCH] ldap: set invalid_data event Currently in parse_request function LdapEvent::InvalidData is not set when a request is not parsed correctly. Ticket #8258 --- rust/src/ldap/ldap.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/rust/src/ldap/ldap.rs b/rust/src/ldap/ldap.rs index 71c3db65a4..db889d12d6 100644 --- a/rust/src/ldap/ldap.rs +++ b/rust/src/ldap/ldap.rs @@ -257,6 +257,7 @@ impl LdapState { return AppLayerResult::incomplete(consumed as u32, needed as u32); } Err(_) => { + self.set_event(LdapEvent::InvalidData); return AppLayerResult::err(); } } @@ -372,9 +373,7 @@ impl LdapState { return AppLayerResult::ok(); } - fn parse_request_udp( - &mut self, flow: *mut Flow, stream_slice: StreamSlice, - ) -> AppLayerResult { + fn parse_request_udp(&mut self, flow: *mut Flow, stream_slice: StreamSlice) -> AppLayerResult { let input = stream_slice.as_slice(); let _pdu = Frame::new( flow, @@ -410,9 +409,7 @@ impl LdapState { return AppLayerResult::ok(); } - fn parse_response_udp( - &mut self, flow: *mut Flow, stream_slice: StreamSlice, - ) -> AppLayerResult { + fn parse_response_udp(&mut self, flow: *mut Flow, stream_slice: StreamSlice) -> AppLayerResult { let input = stream_slice.as_slice(); if input.is_empty() { return AppLayerResult::ok();