[vlc-commits] hds: avoid NULL dereference and use-after-free

Tristan Matthews git at videolan.org
Wed Nov 5 15:16:33 CET 2014


vlc | branch: master | Tristan Matthews <tmatth at videolan.org> | Wed Nov  5 08:27:13 2014 -0500| [0e1d397ea39d032042055d9396c14b80b0fd4bac] | committer: Tristan Matthews

hds: avoid NULL dereference and use-after-free

(cid #1251048 and #1251059)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0e1d397ea39d032042055d9396c14b80b0fd4bac
---

 modules/stream_filter/hds/hds.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/stream_filter/hds/hds.c b/modules/stream_filter/hds/hds.c
index c7c45a4..7e3c017 100644
--- a/modules/stream_filter/hds/hds.c
+++ b/modules/stream_filter/hds/hds.c
@@ -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;
         }



More information about the vlc-commits mailing list