changeset 8638:a2fa276b8ec7

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>
author arpi
date Sun, 29 Dec 2002 15:34:50 +0000
parents 0211de3039eb
children f18ef6a69b27
files libmpdvdkit2/libdvdcss.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdvdkit2/libdvdcss.c	Sun Dec 29 15:32:56 2002 +0000
+++ b/libmpdvdkit2/libdvdcss.c	Sun Dec 29 15:34:50 2002 +0000
@@ -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);