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

Jean-Baptiste Kempf <[email protected]> Fri, 02 Mar 2018 16:44:49 +0100
Newsgroups gmane.comp.video.videolan.libdvdcss,gmane.comp.video.videolan.libdvdcss.devel
Message-ID <[email protected]>
--===============3558751462304076401==
Content-Type: multipart/alternative;
 boundary="--==_mimepart_5a997171713d5_2983ff2f50e86ac33986b";
 charset=UTF-8
Content-Transfer-Encoding: 7bit


----==_mimepart_5a997171713d5_2983ff2f50e86ac33986b
Content-Type: text/plain;
 charset=UTF-8
Content-Transfer-Encoding: quoted-printable

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 &lt;[email protected]&gt;

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

Signed-off-by: Jean-Baptiste Kempf &lt;[email protected]&gt;

- - - - -


2 changed files:

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


Changes:

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
src/css.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- 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 =3D 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 =3D "unknown status"; break;
     }
 =

+    *p_region =3D '\0';
     for( i_region =3D 0; i_region < 8; i_region++ )
     {
         if( !( i_mask & ( 1 << i_region ) ) )


=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
src/libdvdcss.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- 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 =3D=3D NULL &&
       ( p_stream =3D=3D NULL || p_stream_cb =3D=3D NULL ) )
     {
+        dvdcss->psz_device =3D NULL;
         goto error;
     }
 =




View it on GitLab: https://code.videolan.org/videolan/libdvdcss/compare/d=
4383c541a5a781001b718ad4e01917c63c9f2a4...f88ec35dfd616ca94217658523ca5b8=
de0a2cb73

---
View it on GitLab: https://code.videolan.org/videolan/libdvdcss/compare/d=
4383c541a5a781001b718ad4e01917c63c9f2a4...f88ec35dfd616ca94217658523ca5b8=
de0a2cb73
You're receiving this email because of your account on code.videolan.org.=


----==_mimepart_5a997171713d5_2983ff2f50e86ac33986b--

--===============3558751462304076401==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KbGliZHZkY3Nz
LWRldmVsIG1haWxpbmcgbGlzdApsaWJkdmRjc3MtZGV2ZWxAdmlkZW9sYW4ub3JnCmh0dHBzOi8v
bWFpbG1hbi52aWRlb2xhbi5vcmcvbGlzdGluZm8vbGliZHZkY3NzLWRldmVsCg==

--===============3558751462304076401==--