]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
nfs4: remove panic calls, set events instead
authorVictor Julien <victor@inliniac.net>
Thu, 19 Jul 2018 13:45:08 +0000 (15:45 +0200)
committerVictor Julien <victor@inliniac.net>
Fri, 20 Jul 2018 06:32:34 +0000 (08:32 +0200)
rust/src/nfs/nfs4.rs

index a5d85fc08918b7c35cb3e4c89592218e2228d603..34cae4a59f0f9e78a87abcc5fefc04d71b5a3e9a 100644 (file)
@@ -213,7 +213,11 @@ impl NFSState {
                             self.set_event(NFSEvent::MalformedData);
                             return 0;
                         },
-                        IResult::Error(e) => { panic!("NFSPROC4_COMPOUND/GSS INTEGRITIY: Parsing failed: {:?}",e);  },
+                        IResult::Error(_e) => {
+                            SCLogDebug!("NFSPROC4_COMPOUND/GSS INTEGRITIY: Parsing failed: {:?}", _e);
+                            self.set_event(NFSEvent::MalformedData);
+                            return 0;
+                        },
                     }
                 }
             }
@@ -227,7 +231,10 @@ impl NFSState {
                     SCLogDebug!("NFSPROC4_COMPOUND: INCOMPLETE {:?}", _n);
                     self.set_event(NFSEvent::MalformedData);
                 },
-                IResult::Error(e) => { panic!("NFSPROC4_COMPOUND: Parsing failed: {:?}",e);  },
+                IResult::Error(_e) => {
+                    SCLogDebug!("NFSPROC4_COMPOUND: Parsing failed: {:?}", _e);
+                    self.set_event(NFSEvent::MalformedData);
+                },
             };
         }
 
@@ -312,7 +319,11 @@ impl NFSState {
                         self.set_event(NFSEvent::MalformedData);
                         return 0;
                     },
-                    IResult::Error(e) => { panic!("NFSPROC4_COMPOUND/GSS INTEGRITIY: Parsing failed: {:?}",e);  },
+                    IResult::Error(_e) => {
+                        SCLogDebug!("NFSPROC4_COMPOUND/GSS INTEGRITIY: Parsing failed: {:?}", _e);
+                        self.set_event(NFSEvent::MalformedData);
+                        return 0;
+                    },
                 }
             }
             match parse_nfs4_response_compound(data) {
@@ -323,7 +334,10 @@ impl NFSState {
                 IResult::Incomplete(_) => {
                     self.set_event(NFSEvent::MalformedData);
                 },
-                IResult::Error(e) => { panic!("Parsing failed: {:?}",e);  },
+                IResult::Error(_e) => {
+                    SCLogDebug!("Parsing failed: {:?}", _e);
+                    self.set_event(NFSEvent::MalformedData);
+                },
             };
         }
         0