summaryrefslogtreecommitdiff
path: root/extra/grip/grip-3.3.1-invalid-genre-size.patch
blob: c826fc6e2e8092a3eba424679042ee0b5f584aca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
http://bugs.gentoo.org/285105

--- grip-3.3.1/src/id3.c
+++ grip-3.3.1/src/id3.c
@@ -252,8 +252,8 @@
       
       if ( frames[ i ] ) {
 	char *c_data = NULL;
-	char gen[ 5 ] = "(   )";
-	char trk[ 4 ] = "   ";
+	char gen[ 6 ] = "(   )"; /* max unsigned char: 255 */
+	char trk[ 3 ] = "  "; /* max CDDA tracks: 99 */
 	
 	switch( frameids[ i ] ) {
 	case ID3FID_TITLE:
@@ -278,12 +278,12 @@
 	  
 	case ID3FID_CONTENTTYPE:
 	  c_data = gen;
-	  sprintf( gen, "(%d)", genre ); /* XXX */
+	  snprintf( gen, 6, "(%d)", genre );
 	  break;
 	  
 	case ID3FID_TRACKNUM:
 	  c_data = trk;
-	  sprintf( trk, "%d", tracknum ); /* XXX */
+	  snprintf( trk, 3, "%d", tracknum );
 	  break;
 	  
 	default: