Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ClamAV: devel
Silly code in clamav-0.93.1/shared/cfgparser.c
 

Index | Next | Previous | View Flat


dfs at roaringpenguin

Jun 12, 2008, 7:35 AM


Views: 877
Permalink
Silly code in clamav-0.93.1/shared/cfgparser.c

Hi,

Just auditing the ClamAV code, I see:

289 char *cpy = (char *) calloc(strlen(arg), 1);
290 strncpy(cpy, arg, strlen(arg) - 1);
291 cpy[strlen(arg)-1]='\0';

Ummm... whaaa???

Surely you mean: cpy = strdup(arg);

At the very least, you need to check the return from calloc().

Regards,

David.
_______________________________________________
http://lurker.clamav.net/list/clamav-devel.html
Please submit your patches to our Bugzilla: http://bugs.clamav.net

Subject User Time
Silly code in clamav-0.93.1/shared/cfgparser.c dfs at roaringpenguin Jun 12, 2008, 7:35 AM
    Re: Silly code in clamav-0.93.1/shared/cfgparser.c dfs at roaringpenguin Jun 12, 2008, 7:39 AM
    Re: Silly code in clamav-0.93.1/shared/cfgparser.c tkojm at clamav Jun 12, 2008, 2:20 PM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.