[libdvdcss-devel] [Git][videolan/libdvdcss][master] 2 commits: Fix buffer overflow when region mask is 0x0

Jean-Baptiste Kempf gitlab at videolan.org
Fri Mar 2 16:44:49 CET 2018


Jean-Baptiste Kempf pushed to branch master at VideoLAN / libdvdcss


Commits:
eab96264 by Pierre Lamot at 2018-03-02T16:43:19+01:00
Fix buffer overflow when region mask is 0x0

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

- - - - -
f88ec35d by Hugo Beauzée-Luyssen at 2018-03-02T16:44:36+01:00
Fix potential free of uninitialized pointer

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

- - - - -


2 changed files:

- src/css.c
- src/libdvdcss.c


Changes:

=====================================
src/css.c
=====================================
--- a/src/css.c
+++ b/src/css.c
@@ -101,7 +101,7 @@ static int  dvdcss_titlekey ( dvdcss_t, int, dvd_key );
 int dvdcss_test( dvdcss_t dvdcss )
 {
     const char *psz_type, *psz_rpc;
-    char psz_region[16];
+    char psz_region[17];
     char *p_region = psz_region;
     int i_ret, i_copyright, i_type, i_mask, i_rpc, i_region;
 
@@ -160,6 +160,7 @@ int dvdcss_test( dvdcss_t dvdcss )
         default: psz_type = "unknown status"; break;
     }
 
+    *p_region = '\0';
     for( i_region = 0; i_region < 8; i_region++ )
     {
         if( !( i_mask & ( 1 << i_region ) ) )


=====================================
src/libdvdcss.c
=====================================
--- a/src/libdvdcss.c
+++ b/src/libdvdcss.c
@@ -522,6 +522,7 @@ static dvdcss_t dvdcss_open_common ( const char *psz_target, void *p_stream,
     if( psz_target == NULL &&
       ( p_stream == NULL || p_stream_cb == NULL ) )
     {
+        dvdcss->psz_device = NULL;
         goto error;
     }
 



View it on GitLab: https://code.videolan.org/videolan/libdvdcss/compare/d4383c541a5a781001b718ad4e01917c63c9f2a4...f88ec35dfd616ca94217658523ca5b8de0a2cb73

---
View it on GitLab: https://code.videolan.org/videolan/libdvdcss/compare/d4383c541a5a781001b718ad4e01917c63c9f2a4...f88ec35dfd616ca94217658523ca5b8de0a2cb73
You're receiving this email because of your account on code.videolan.org.


More information about the libdvdcss-devel mailing list