[Snort-devel] Frag3 Options Check
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(strok && isdigit((int)stoks))
global_config.max_frags = atoi(stoks);
@@ -1078,7 +1078,7 @@ static void Frag3ParseGlobalArgs(u_char
else if(!strcasecmp(stoks, "prealloc_frags"))
- if(stoks && isdigit((int)stoks))
global_config.static_frags = atoi(stoks);
global_config.use_prealloc = 1;
Senior Software Engineer
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...
More information about the Snort-devel