[vlc-devel] [PATCH] demux/playlist/xspf: prevent crash on empty <vlc:id>

Filip Roséen filip at atch.se
Wed Mar 15 10:07:32 CET 2017


psz_value is given a value when the node type is XML_READER_TEXT, but
given that this is not guaranteed to ever happen before
XML_READER_ENDELEM there is nothing stating that psz_value is not
NULL.

fixes: #18125
---
 modules/demux/playlist/xspf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/demux/playlist/xspf.c b/modules/demux/playlist/xspf.c
index 16ee1b31a2..73be5ced12 100644
--- a/modules/demux/playlist/xspf.c
+++ b/modules/demux/playlist/xspf.c
@@ -741,7 +741,7 @@ static bool parse_extension_node COMPLEX_INTERFACE
                 }
 
                 /* special tag <vlc:id> */
-                if (!strcmp(p_handler->name, "vlc:id"))
+                if (!strcmp(p_handler->name, "vlc:id") && psz_value )
                 {
                     p_demux->p_sys->i_track_id = atoi(psz_value);
                 }
-- 
2.12.0


More information about the vlc-devel mailing list