Snort mailing list archives
Segmentation fault while reloading configuration
From: Hugo Vasconcelos Saldanha <hugovs () gmail com>
Date: Thu, 27 Mar 2014 20:06:57 -0300
Hi snort-devel,
While testing snort dynamic reconfiguration feature (--enable-reload),
I'm getting a segfault in function VerifyOutputs(). The code is
similar in versions 2.9.6.0 and 2.9.7.0.alpha. Problematic line of
code is (snort.c:6125 in 2.9.6.0):
if (strcasecmp(old_output_config->opts,
new_output_config->opts) == 0)
Pointers are not tested before calling strcasecmp(). This only happens
when verifying old and new rule_type_output_configs arrays. Some lines
of code before, the options pointer is tested.
The following patch works for me.
--- snort.c.orig 2014-03-27 22:17:37.945505347 +0000
+++ snort.c 2014-03-27 22:33:29.864583499 +0000
@@ -6122,8 +6122,15 @@ static int VerifyOutputs(SnortConfig *ol
if (strcasecmp(old_output_config->keyword,
new_output_config->keyword) == 0)
{
- if (strcasecmp(old_output_config->opts,
- new_output_config->opts) == 0)
+ if ((old_output_config->opts != NULL) &&
+ (new_output_config->opts != NULL) &&
+ (strcasecmp(old_output_config->opts,
new_output_config->opts) == 0))
+ {
+ new_outputs++;
+ break;
+ }
+ else if (old_output_config->opts == NULL &&
+ new_output_config->opts == NULL)
{
new_outputs++;
break;
--
Hugo
------------------------------------------------------------------------------
_______________________________________________
Snort-devel mailing list
Snort-devel () lists sourceforge net
https://lists.sourceforge.net/lists/listinfo/snort-devel
Archive:
http://sourceforge.net/mailarchive/forum.php?forum_name=snort-devel
Please visit http://blog.snort.org for the latest news about Snort!
Current thread:
- Segmentation fault while reloading configuration Hugo Vasconcelos Saldanha (Mar 27)
- Re: Segmentation fault while reloading configuration Josh Rosenbaum (jrosenba) (Mar 28)
