[dovecot] Re: vsnprintf()

Timo Sirainen tss at iki.fi
Wed Oct 23 16:16:36 EEST 2002


On Wed, 2002-10-23 at 14:18, Thomas Wouters wrote:
> I think I stumbled upon a bug in the i_snprintf() function. In the case of
> vnsprintf() being available, it depends on vnsprintf() returning -1 when the
> string was longer than the passed-in limit (or it won't terminate the
> string.). But this isn't the C99-standardized behaviour, and newer glibc's
> don't do that anymore either, so you can end up with a non-terminated
> string. This patch should fix it, I think.

Hm. vsnprintf() does terminate the string with \0 always, unless it
returns -1. But I'll apply the patch anyway just to be sure :) Also
my_vsyslog() didn't check the vsnprintf() return value at all. Have to
go through that lib code more carefully some day..




More information about the dovecot mailing list