1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-23 23:32:26 +00:00

The attached patch fixes a crash on *my* environment with certain DVD's.

The sprintf function has been replaced by an snprintf function to prevent
the buffer overflow.
Erik Oomen <erik.oomen@home.nl>


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8639 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
arpi 2002-12-29 15:34:50 +00:00
parent 36048f18e1
commit 2a45b3cb72

View File

@ -289,7 +289,7 @@ extern dvdcss_t dvdcss_open ( char *psz_target )
for ( i=0;i<16;i++ )
if ( ( title_name[i] < '0' )||( title_name[i] > '9' ) ){
disc_id=malloc(16+4);
sprintf( disc_id,"%.2X%.2X%.2X%.2X%.2X%.2X%.2X%.2X",title_name[0],title_name[1],title_name[2],title_name[3],title_name[4],title_name[5],title_name[6],title_name[7] );
snprintf( disc_id,17,"%.2X%.2X%.2X%.2X%.2X%.2X%.2X%.2X",title_name[0],title_name[1],title_name[2],title_name[3],title_name[4],title_name[5],title_name[6],title_name[7] );
break;
}
if(!disc_id) disc_id=strdup(title_name);