Re: [SPAM] Re: Small bug found

"Kai Risku" <[email protected]> Tue, 14 May 2013 18:59:51 +0300
Newsgroups gmane.mail.spam.crm114
Message-ID <[email protected]>
The version is 20100106-BlameMichelson

A quick grep seems to indicate that the other classifiers actually do a strdup to save the filename instead on indexing into the htext buffer. I don't know if there is a risk that the htext buffer gets overwritten, but my patch seems to work properly for me.

I also just noticed that the strdup:ed filenames in the other classifiers never get freed, so you actually have a small memory leak there.. :)

--
[email protected]     GSM  +358-40-767 8282
Oy Arrak Software Ab   http://www.arrak.fi


-----Original Message-----
From: [email protected] [mailto:[email protected]] 
Sent: Tuesday, May 14, 2013 17:07
To: Kai Risku
Cc: [email protected]
Subject: [Crm114-general] [SPAM] Re: Small bug found

"Kai Risku" <[email protected]> writes:

Interesting... I haven't updated the mainline in a few years (work has sorta focussed over onto the callable library.

Let me pop a distro open.   Which version are you running?  

   - Bill


> Markovian classifier tries to update the timestamp of the css file, but unfortunately has lost the filename to use. 
>
> Here is a patch:
>
>
> --- crm_markovian.c.orig        2013-05-13 12:51:52.000000000 +0300
> +++ crm_markovian.c     2013-05-13 12:53:15.000000000 +0300
> @@ -148,6 +148,8 @@
>    //             filename starts at i,  ends at j. null terminate it.
>    htext[j] = '\000';
>
> +  int filenameidx = i;
> +
>    //             and stat it to get it's length
>    k = stat (&htext[i], &statbuf);
>
> @@ -724,7 +726,7 @@
>    {
>      int hfd;                  //  hashfile fd
>      FEATURE_HEADER_STRUCT foo;
> -    hfd = open (&(htext[i]), O_RDWR);
> +    hfd = open (&(htext[filenameidx]), O_RDWR);
>      dontcare = read (hfd, &foo, sizeof(foo));
>      lseek (hfd, 0, SEEK_SET);
>      dontcare = write (hfd, &foo, sizeof(foo));
>
>
>
> --
> [email protected]     GSM  +358-40-767 8282
> Oy Arrak Software Ab   http://www.arrak.fi
>
>
>
>
>
>
> ----------------------------------------------------------------------
> -------- AlienVault Unified Security Management (USM) platform 
> delivers complete security visibility with the essential security 
> capabilities. Easily and efficiently configure, manage, and operate 
> all of your security controls from a single console and one unified 
> framework. Download a free trial.
> http://p.sf.net/sfu/alienvault_d2d
> _______________________________________________
> Crm114-general mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/crm114-general



------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d