ldap: set invalid_data event

Currently in parse_request function LdapEvent::InvalidData is not set when a
request is not parsed correctly.

Ticket #8258
pull/14931/head
Giuseppe Longo 6 months ago committed by Victor Julien
parent 2480f8c038
commit de46f4ba9d

@ -257,6 +257,7 @@ impl LdapState {
return AppLayerResult::incomplete(consumed as u32, needed as u32); return AppLayerResult::incomplete(consumed as u32, needed as u32);
} }
Err(_) => { Err(_) => {
self.set_event(LdapEvent::InvalidData);
return AppLayerResult::err(); return AppLayerResult::err();
} }
} }
@ -372,9 +373,7 @@ impl LdapState {
return AppLayerResult::ok(); return AppLayerResult::ok();
} }
fn parse_request_udp( fn parse_request_udp(&mut self, flow: *mut Flow, stream_slice: StreamSlice) -> AppLayerResult {
&mut self, flow: *mut Flow, stream_slice: StreamSlice,
) -> AppLayerResult {
let input = stream_slice.as_slice(); let input = stream_slice.as_slice();
let _pdu = Frame::new( let _pdu = Frame::new(
flow, flow,
@ -410,9 +409,7 @@ impl LdapState {
return AppLayerResult::ok(); return AppLayerResult::ok();
} }
fn parse_response_udp( fn parse_response_udp(&mut self, flow: *mut Flow, stream_slice: StreamSlice) -> AppLayerResult {
&mut self, flow: *mut Flow, stream_slice: StreamSlice,
) -> AppLayerResult {
let input = stream_slice.as_slice(); let input = stream_slice.as_slice();
if input.is_empty() { if input.is_empty() {
return AppLayerResult::ok(); return AppLayerResult::ok();

Loading…
Cancel
Save