David F. Skoll wrote:

> 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);

Oops, followed by:  cpy[strlen(arg)-1] = 0;

to chop off the trailing 'm' or 'k'.

Regards,

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

Reply via email to