[vlc-devel] [vlc-commits] playlist: m3u: use cctype

Francois Cartegnie fcvlcdev at free.fr
Thu Mar 12 16:38:01 CET 2020


Le 12/03/2020 à 15:03, Remi Denis-Courmont a écrit :

>> @@ -230,17 +232,16 @@ static int ReadDir( stream_t *p_demux,
>> input_item_node_t *p_subitems )
>>          char *psz_parse = psz_line;
>>
>>          /* Skip leading tabs and spaces */
>> -        while( *psz_parse == ' ' || *psz_parse == '\t' ||
>> -               *psz_parse == '\n' || *psz_parse == '\r' ) psz_parse++;
>> +        while( isspace( *psz_parse ) )
> 
> This is UB if *psz_parse is non-ASCII. And even if it is ASCII, parsing
> M3U should not depend on the user locale.
> 
I don't see why that would still be undefined with utf8 if we use _l
locale C ones. Even if, UB for a bool would break parsing as much as
broken separators.

-- 
Francois Cartegnie
VideoLAN - VLC Developer


More information about the vlc-devel mailing list