]> git.sesse.net Git - vlc/commitdiff
hds: avoid NULL dereference and use-after-free
authorTristan Matthews <tmatth@videolan.org>
Wed, 5 Nov 2014 13:27:13 +0000 (08:27 -0500)
committerTristan Matthews <tmatth@videolan.org>
Wed, 5 Nov 2014 13:32:19 +0000 (08:32 -0500)
(cid #1251048 and #1251059)

modules/stream_filter/hds/hds.c

index c7c45a40f5474ed46c4cf231e2670e2291b04cdf..7e3c01771bb6ec0ed0b5fce5e9b9cb19a756f897 100644 (file)
@@ -1247,7 +1247,7 @@ static int parse_Manifest( stream_t *s, manifest_t *m )
 
             break;
         case XML_READER_ENDELEM:
-            if( ! strcmp( current_element, "bootstrapInfo") ) {
+            if( current_element && ! strcmp( current_element, "bootstrapInfo") ) {
                 if( bootstrap_idx + 1 == MAX_BOOTSTRAP_INFO ) {
                     msg_Warn( (vlc_object_t*) s, "Too many bootstraps, ignoring" );
                 } else {
@@ -1256,6 +1256,7 @@ static int parse_Manifest( stream_t *s, manifest_t *m )
             }
 
             free( current_element );
+            current_element = NULL;
             element_stack[current_element_idx--] = 0;
             break;
         }