[vlc-devel] Fix a potential buffer overflow in the samba access

Laurent Aimar fenrir at elivagar.org
Tue Nov 2 20:48:43 CET 2010


On Tue, Nov 02, 2010 at 07:34:07PM +0100, Ludovic Fauvet wrote:
> 2010/11/2 Rémi Denis-Courmont <remi at remlab.net>:
> >> Patch #0001 fixes a potential buffer overflow (Win32 only) on a call
> >> to snprintf.
> >
> > snprintf() writes n bytes *including* the terminating nul.
> > This patch looks totally useless.
> Right.
> I didn't read the man carefully, I guessed that the terminal nul byte
> wasn't written if the input string was truncated by snprintf.
 On win32, _snprintf is not a valid c99 snprintf, where the return value
is not the same and the terminating nul character is not present when
the string is truncated.
 But VLC does not define snprintf to _snprintf on win32 (but I am not sure
who actually defines it).


More information about the vlc-devel mailing list