[vlc-devel] [vlc-commits] playlist: m3u: use cctype
Remi Denis-Courmont
remi at remlab.net
Thu Mar 12 17:24:44 CET 2020
Le 2020-03-12 17:38, Francois Cartegnie a écrit :
> 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.
I fail to see the relevance of UTF-8 here.
> Even if, UB for a bool would break parsing as much as broken
> separators.
If you're not going to revert the patch, I can do that myself, but that
will involve reverting any intermediate patch.
--
Rémi Denis-Courmont
More information about the vlc-devel
mailing list