2010.07.08 16:25 "[Tiff] strlcpy vs strncpy", by Bob Friesenhahn

2010.07.11 17:36 "Re: [Tiff] strlcpy vs strncpy", by Edward Lam

On Thu, July 8, 2010 14:06, Olivier Paquet wrote:

This seems to only affect tiffcrop and tiffsplit in a few places so maybe we could fix the code too? Some cases in tiffsplit appear useless anyway (strncpy in a buffer which was dynamically allocated to be large enough to contain the string).

I only see problematic uses of strncpy in tiffcrop. The other uses of strncpy (tiff2pdf, tiffsplit) use the common practice of explicitly NUL terminating the destination buffer immediately afterwards (ie. perform truncation).

I don't see any problems with switching to use of strlcpy() as a means to ensure safer (even if not ideal) behaviour. As long as this is a better than nothing solution. :)

Regards,

-Edward