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

Rémi Denis-Courmont remi at remlab.net
Tue Jan 21 01:48:25 CET 2014


On Mon, 20 Jan 2014 15:33:41 +0100, "Steinar H. Gunderson"
<sgunderson at bigfoot.com> wrote:
> On Mon, Jan 20, 2014 at 11:15:06PM +0900, Iwao AVE! wrote:
>> +#ifdef __APPLE__
>> +    /*
>> +     * The returned value is in characters instead of bytes.
>> +     * Each character could occupy 4 bytes in UTF-8.
>> +     */
>> +    len *= 4;
>> +#endif
> 
> A Unicode code point can occupy up to six bytes in UTF-8.

No. The largest legal Unicode code point is 0x10FFFF, which is represented
with 4 bytes in UTF-8. But that is not very relevant. If the MacOS size
limit for file names is 255 characters, then fpathconf() needs to return
1020 (or was it 1021), but I do not see why the limit would be in
characters, unless the underlying file system format stores names in UTF-32
format. 

-- 
Rémi Denis-Courmont
Sent from my collocated server



More information about the vlc-devel mailing list