[Snort-devel] Frag3 Options Check

Joel Ebrahimi jebrahimi at ...2280...
Wed May 30 18:44:36 EDT 2007


I was testing frag3 today. I already wrote in to the snort team about some doc fixes but also during testing I wanted to see what (if any) the prealloc_frags defaulted too.
So I had specified the prealloc_frags to frag3 global but left off a value. The result was a segfault. I took a look at the code and noticed there are a few places where the code ensures that there is a corresponding value to an option when it requires it but there were a few places where there were no safety check.

This patch will prevent a segfault and be more consistent with the other code that looks for this option/value pair.

--- spp_frag3.c 2007-05-30 16:28:26.000000000 -0600
+++ spp_frag3.c.orig    2007-05-30 09:25:20.000000000 -0600
@@ -1004,7 +1004,7 @@ static void Frag3ParseGlobalArgs(u_char

             if(!strcasecmp(stoks[0], "max_frags"))
             {
-                if(strok[1] && isdigit((int)stoks[1][0]))
+                if(isdigit((int)stoks[1][0]))
                 {
                     global_config.max_frags = atoi(stoks[1]);
                 }
@@ -1078,7 +1078,7 @@ static void Frag3ParseGlobalArgs(u_char
             }
             else if(!strcasecmp(stoks[0], "prealloc_frags"))
             {
-                if(stoks[1] && isdigit((int)stoks[1][0]))
+                if(isdigit((int)stoks[1][0]))
                 {
                     global_config.static_frags = atoi(stoks[1]);
                     global_config.use_prealloc = 1;


// Joel 

StillSecure
Joel Ebrahimi
Senior Software Engineer

http://www.stillsecure.com/
The information transmitted is intended only for the person
to whom it is addressed and may contain confidential material.
Review or other use of this information by persons other than
the intended recipient is prohibited. If you've received
this in error, please contact the sender and delete
from any computer.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.snort.org/pipermail/snort-devel/attachments/20070530/f70a9141/attachment.html>


More information about the Snort-devel mailing list