From: Philippe Antoine Date: Fri, 11 Sep 2020 07:44:25 +0000 (+0200) Subject: dceprc: signature rust check with is_char_boundary X-Git-Tag: suricata-6.0.0-rc1~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=15447cc672db53aa4e39de6a403396a3b6ed9e22;p=thirdparty%2Fsuricata.git dceprc: signature rust check with is_char_boundary before calling split_at which would panic --- diff --git a/rust/src/dcerpc/detect.rs b/rust/src/dcerpc/detect.rs index 7e1296c3ae..8f1b27727f 100644 --- a/rust/src/dcerpc/detect.rs +++ b/rust/src/dcerpc/detect.rs @@ -60,7 +60,7 @@ pub struct DCEOpnumData { } fn extract_op_version(opver: &str) -> Result<(u8, u16), ()> { - if opver.len() < 1 { + if !opver.is_char_boundary(1){ return Err(()); } let (op, version) = opver.split_at(1);