Commit 0e1d397e authored by Tristan Matthews's avatar Tristan Matthews

hds: avoid NULL dereference and use-after-free

(cid #1251048 and #1251059)
parent fa447d33
...@@ -1247,7 +1247,7 @@ static int parse_Manifest( stream_t *s, manifest_t *m ) ...@@ -1247,7 +1247,7 @@ static int parse_Manifest( stream_t *s, manifest_t *m )
break; break;
case XML_READER_ENDELEM: case XML_READER_ENDELEM:
if( ! strcmp( current_element, "bootstrapInfo") ) { if( current_element && ! strcmp( current_element, "bootstrapInfo") ) {
if( bootstrap_idx + 1 == MAX_BOOTSTRAP_INFO ) { if( bootstrap_idx + 1 == MAX_BOOTSTRAP_INFO ) {
msg_Warn( (vlc_object_t*) s, "Too many bootstraps, ignoring" ); msg_Warn( (vlc_object_t*) s, "Too many bootstraps, ignoring" );
} else { } else {
...@@ -1256,6 +1256,7 @@ static int parse_Manifest( stream_t *s, manifest_t *m ) ...@@ -1256,6 +1256,7 @@ static int parse_Manifest( stream_t *s, manifest_t *m )
} }
free( current_element ); free( current_element );
current_element = NULL;
element_stack[current_element_idx--] = 0; element_stack[current_element_idx--] = 0;
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment