[Snort-devel] Snort 1.8.6, configuration files and coredumps

Richard Dawe Richard.Dawe at ...1346...
Tue Apr 30 07:59:04 EDT 2002


Hello.

I've just tried to use snort 1.8.6's 'config reference_net'
option and found that it coredumps. Below is a diff to
fix this problem. GenHomenet is entered from
the configuration parsing with optarg == NULL, hence
the coredump. For reference I used a line like:

    config reference_net: $HOME_NET

where $HOME_NET was set earlier.

Also if I use 'config interface', but do not specify
an interface, I get a coredump.

The configuration file parser doesn't seem very resilient.

Thanks, regards,

Richard Dawe, Software Engineer, Riverstone Networks, UK
richard.dawe at ...1346..., http://www.riverstonenet.com/

--- snort-1.8.6/snort.c Mon Apr  8 17:04:53 2002
+++ snort-1.8.6.rdawe/snort.c   Tue Apr 30 15:22:34 2002
@@ -1270,12 +1270,12 @@ void GenHomenet(char *netdata)
 {
     struct in_addr net;                /* place to stick the local network data */
     char **toks;                /* dbl ptr to store mSplit return data in */
-    int num_toks;                /* number of tokens mSplit returns */
+    int num_toks = 0;                /* number of tokens mSplit returns */
     int nmask;                        /* temporary netmask storage */
     int i;

     /* break out the CIDR notation from the IP address */
-    toks = mSplit(optarg, "/", 2, &num_toks, 0);
+    toks = mSplit(netdata, "/", 2, &num_toks, 0);

     if(num_toks > 1)
     {




More information about the Snort-devel mailing list