segmentation fault in dccproc (1.3.24)

Vernon Schryver vjs@calcite.rhyolite.com
Sat Dec 10 16:25:50 UTC 2005


> From: Jeff Mincy 

> gdb reports the segmentation fault occurs at this call to STRLCPY

>     #undef HAVE_STRLCPY.
> So, I'm presumably getting this definition:
>    ./include/dcc_defs.h:#define STRLCPY(d,s,lim) ((d)[(lim)-1] = '\0', strncpy(d,s,(lim)-1))
>
> Doing if (i > 0) { ... } around the STRLCPY prevented the segmentation fault.

Thank you for figuring out the problem.  The headers would not have been
enough, because I was not seeing the 0 length and the strlcpy() in FreeBSD
is silent (i.e. doesn't crash) on that error.

Besides making STRLCPY() not crash with lim=0,
dccproc needs to not try to copy a mail_host of length -1.


thanks,
Vernon Schryver    vjs@rhyolite.com



More information about the DCC mailing list

Contact vjs@rhyolite.com by mail or use the form.