changeset 12289:e197979a0883

potentially exploitable buffer overflow with maliciously crafted cd toc
author rfelker
date Mon, 26 Apr 2004 09:33:35 +0000
parents 8c8c71a02e5a
children de133f53c88f
files libmpdemux/cddb.c
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/cddb.c	Mon Apr 26 09:22:17 2004 +0000
+++ b/libmpdemux/cddb.c	Mon Apr 26 09:33:35 2004 +0000
@@ -587,6 +587,7 @@
 	ptr = offsets;
 	for( i=0; i<cddb_data->tracks ; i++ ) {
 		ptr += sprintf(ptr, "%d+", cdtoc[i].frame );
+		if (ptr-offsets > sizeof offsets - 40) break;
 	}
 	ptr[0]=0;
 	time_len = (cdtoc[cddb_data->tracks].frame)/75;