[vlc-devel] [vlc-commits] playlist: m3u: use cctype
Remi Denis-Courmont
remi at remlab.net
Thu Mar 12 15:03:16 CET 2020
Le 2020-03-12 14:27, Francois Cartegnie a écrit :
> vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Mar
> 11 10:49:17 2020 +0100| [984fa85411f3129ea7f9fd71168401f3e4a92e12] |
> committer: Francois Cartegnie
>
> playlist: m3u: use cctype
>
>> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=984fa85411f3129ea7f9fd71168401f3e4a92e12
> ---
>
> modules/demux/playlist/m3u.c | 17 +++++++++--------
> 1 file changed, 9 insertions(+), 8 deletions(-)
>
> diff --git a/modules/demux/playlist/m3u.c
> b/modules/demux/playlist/m3u.c
> index 9675bc84cb..e9d0238918 100644
> --- a/modules/demux/playlist/m3u.c
> +++ b/modules/demux/playlist/m3u.c
> @@ -36,6 +36,8 @@
>
> #include "playlist.h"
>
> +#include <ctype.h>
> +
>
> /*****************************************************************************
> * Local prototypes
>
> *****************************************************************************/
> @@ -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.
Please revert.
--
Rémi Denis-Courmont
More information about the vlc-devel
mailing list