Commit eab96264 authored by Pierre Lamot's avatar Pierre Lamot Committed by Jean-Baptiste Kempf

Fix buffer overflow when region mask is 0x0

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent d4383c54
...@@ -101,7 +101,7 @@ static int dvdcss_titlekey ( dvdcss_t, int, dvd_key ); ...@@ -101,7 +101,7 @@ static int dvdcss_titlekey ( dvdcss_t, int, dvd_key );
int dvdcss_test( dvdcss_t dvdcss ) int dvdcss_test( dvdcss_t dvdcss )
{ {
const char *psz_type, *psz_rpc; const char *psz_type, *psz_rpc;
char psz_region[16]; char psz_region[17];
char *p_region = psz_region; char *p_region = psz_region;
int i_ret, i_copyright, i_type, i_mask, i_rpc, i_region; int i_ret, i_copyright, i_type, i_mask, i_rpc, i_region;
...@@ -160,6 +160,7 @@ int dvdcss_test( dvdcss_t dvdcss ) ...@@ -160,6 +160,7 @@ int dvdcss_test( dvdcss_t dvdcss )
default: psz_type = "unknown status"; break; default: psz_type = "unknown status"; break;
} }
*p_region = '\0';
for( i_region = 0; i_region < 8; i_region++ ) for( i_region = 0; i_region < 8; i_region++ )
{ {
if( !( i_mask & ( 1 << i_region ) ) ) if( !( i_mask & ( 1 << i_region ) ) )
......
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