[Mplayer-cvslog] CVS: main/libmpdvdkit2 libdvdcss.c,1.5,1.6

Arpi of Ize arpi at mplayerhq.hu
Sun Dec 29 16:34:53 CET 2002


Update of /cvsroot/mplayer/main/libmpdvdkit2
In directory mail:/var/tmp.root/cvs-serv23858

Modified Files:
	libdvdcss.c 
Log Message:
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 at home.nl>


Index: libdvdcss.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdvdkit2/libdvdcss.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- libdvdcss.c	29 Dec 2002 15:32:56 -0000	1.5
+++ libdvdcss.c	29 Dec 2002 15:34:50 -0000	1.6
@@ -289,7 +289,7 @@
 	        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);




More information about the MPlayer-cvslog mailing list