]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
dceprc: signature rust check with is_char_boundary
authorPhilippe Antoine <contact@catenacyber.fr>
Fri, 11 Sep 2020 07:44:25 +0000 (09:44 +0200)
committerVictor Julien <victor@inliniac.net>
Fri, 11 Sep 2020 08:52:23 +0000 (10:52 +0200)
before calling split_at which would panic

rust/src/dcerpc/detect.rs

index 7e1296c3ae8bd2c04b3d70f5e537c01a32294895..8f1b27727fb6dcacb9dd54bb47b29d18145dfc4a 100644 (file)
@@ -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);