]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
fixed classtype segfault on ctor after parse error
authorRuss Combs <rucombs@cisco.com>
Fri, 31 Oct 2014 20:57:48 +0000 (16:57 -0400)
committerRuss Combs <rucombs@cisco.com>
Fri, 31 Oct 2014 20:57:48 +0000 (16:57 -0400)
ChangeLog
src/ips_options/ips_classtype.cc

index 2c93982d435f3d225580c7fbae1d82b4cb5bef3d..38cd76606d45047afb9af0a8c15bf6702cb67f7c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,7 @@
 -- tweaks from Josh
 -- tweaked inspector execution
 -- fixed parsing of reference with \;
+-- fixed ips classtype segfault on ctor after parse error
 
 126
 -- pulled latest from tom
index 48272c5bec6a05760aaa52dc063226056b1b804f..390e2e96fb2d5f6f0b1cd838d590ebdc45c7afb4 100644 (file)
@@ -89,8 +89,12 @@ static IpsOption* classtype_ctor(Module* p, OptTreeNode* otn)
 {
     ClassTypeModule* m = (ClassTypeModule*)p;
     otn->sigInfo.classType = m->type;
-    otn->sigInfo.class_id = m->type->id;
-    otn->sigInfo.priority = m->type->priority;
+
+    if ( m->type )
+    {
+        otn->sigInfo.class_id = m->type->id;
+        otn->sigInfo.priority = m->type->priority;
+    }
     return nullptr;
 }