[vlc-commits] se/archive: ExtractorOpen: add missing error-check in open

Filip Roséen git at videolan.org
Fri Mar 17 19:05:41 CET 2017


vlc | branch: master | Filip Roséen <filip at atch.se> | Fri Mar 17 12:28:33 2017 +0100| [4a9c32e0a2fa7584393618de74acdd6c30e1b1da] | committer: Jean-Baptiste Kempf

se/archive: ExtractorOpen: add missing error-check in open

The same check is correctly implemented in archive.c:DirectoryOpen,
but is missing from ExtractorOpen - resulting in a null-pointer
dereference if a libarchive handle fails to be created.

fixes: #18133

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/stream_extractor/archive.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/modules/stream_extractor/archive.c b/modules/stream_extractor/archive.c
index bb553bb..a35d9ed 100644
--- a/modules/stream_extractor/archive.c
+++ b/modules/stream_extractor/archive.c
@@ -694,6 +694,9 @@ static int ExtractorOpen( vlc_object_t* p_obj )
     stream_extractor_t* p_extractor = (void*)p_obj;
     private_sys_t* p_sys = CommonOpen( p_obj, p_extractor->source );
 
+    if( p_sys == NULL )
+        return VLC_EGENERIC;
+
     if( archive_seek_subentry( p_sys, p_extractor->identifier ) )
     {
         CommonClose( p_sys );



More information about the vlc-commits mailing list