[vlc-commits] contrib: dvdcss: Apply unreleased upstream patches

Hugo Beauzée-Luyssen git at videolan.org
Mon Mar 5 10:11:30 CET 2018


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Mon Mar  5 10:10:34 2018 +0100| [8c1c88743e1b933540418b043550ef30b8e57f6d] | committer: Hugo Beauzée-Luyssen

contrib: dvdcss: Apply unreleased upstream patches

Fix CD #63baa309-cf38-4b7b-8f8d-803c10be3c48

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

 contrib/src/dvdcss/fix-buffer-overflow.patch | 34 ++++++++++++++++++++++++++++
 contrib/src/dvdcss/fix-uninit-ptr-free.patch | 25 ++++++++++++++++++++
 contrib/src/dvdcss/rules.mak                 |  2 ++
 3 files changed, 61 insertions(+)

diff --git a/contrib/src/dvdcss/fix-buffer-overflow.patch b/contrib/src/dvdcss/fix-buffer-overflow.patch
new file mode 100644
index 0000000000..551e28ccb7
--- /dev/null
+++ b/contrib/src/dvdcss/fix-buffer-overflow.patch
@@ -0,0 +1,34 @@
+From eab9626405faad756ef83f150505467f20bc931f Mon Sep 17 00:00:00 2001
+From: Pierre Lamot <pierre at videolabs.io>
+Date: Thu, 1 Mar 2018 10:41:45 +0100
+Subject: [PATCH 1/2] Fix buffer overflow when region mask is 0x0
+
+Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
+---
+ src/css.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/css.c b/src/css.c
+index f7e5a88..55cb8df 100644
+--- 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 ) ) )
+-- 
+2.11.0
+
diff --git a/contrib/src/dvdcss/fix-uninit-ptr-free.patch b/contrib/src/dvdcss/fix-uninit-ptr-free.patch
new file mode 100644
index 0000000000..47041dfaf1
--- /dev/null
+++ b/contrib/src/dvdcss/fix-uninit-ptr-free.patch
@@ -0,0 +1,25 @@
+From f88ec35dfd616ca94217658523ca5b8de0a2cb73 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= <hugo at beauzee.fr>
+Date: Thu, 1 Mar 2018 11:12:10 +0100
+Subject: [PATCH 2/2] Fix potential free of uninitialized pointer
+
+Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
+---
+ src/libdvdcss.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/libdvdcss.c b/src/libdvdcss.c
+index a659bf3..8f4c421 100644
+--- 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;
+     }
+ 
+-- 
+2.11.0
+
diff --git a/contrib/src/dvdcss/rules.mak b/contrib/src/dvdcss/rules.mak
index db53dd3249..c462b55764 100644
--- a/contrib/src/dvdcss/rules.mak
+++ b/contrib/src/dvdcss/rules.mak
@@ -14,6 +14,8 @@ $(TARBALLS)/libdvdcss-$(DVDCSS_VERSION).tar.bz2:
 
 dvdcss: libdvdcss-$(DVDCSS_VERSION).tar.bz2 .sum-dvdcss
 	$(UNPACK)
+	$(APPLY) $(SRC)/dvdcss/fix-buffer-overflow.patch
+	$(APPLY) $(SRC)/dvdcss/fix-uninit-ptr-free.patch
 	$(MOVE)
 
 .dvdcss: dvdcss



More information about the vlc-commits mailing list