[vlc-devel] [PATCH] Possible buffer overflow in vlc_readdir (fixes #9676)

Rémi Denis-Courmont remi at remlab.net
Sat Jan 18 15:17:05 CET 2014

On Sat, 18 Jan 2014 23:00:41 +0900, "Iwao AVE!" <harawata at gmail.com>
>     long len = fpathconf (dirfd (dir), _PC_NAME_MAX);
>     printf("len = %d\n", len);
> and it always prints 255 on Mac OS X 10.8 and 10.9.

Then it is not possible for a file name in that directory to exceed 255
bytes (in the native encoding). By definition.
So unless the maths VLC performs below the fpathconf() call, is wrong, VLC
has no bug there.

(Whether readdir_r() is useful is a different question, but if you want to
remove it, please check it is OK and please remove vlc_readdir() too.)

Rémi Denis-Courmont
Sent from my collocated server

More information about the vlc-devel mailing list