File grip-3.2.0-buffer-size.diff of Package grip

--- src/id3.c
+++ src/id3.c	2005/09/14 15:58:43
@@ -251,8 +251,8 @@
       
       if ( frames[ i ] ) {
 	char *c_data = NULL;
-	char gen[ 5 ] = "(   )";
-	char trk[ 4 ] = "   ";
+	char gen[ 6 ] = "(   )";
+	char trk[ 5 ] = "   ";
 	
 	switch( frameids[ i ] ) {
 	case ID3FID_TITLE:

This buffer overflow is in MakeAboutPage, so there was no workaround.
The only way to start grip without it, is not not use Japanese
(i.e. delete the translation file ja/grip.mo)

See https://bugzilla.novell.com/show_bug.cgi?id=132459
(Grip locale problem) for details:

--- src/grip.c	2006/03/21 14:55:44	1.1
+++ src/grip.c	2006/03/21 14:56:29
@@ -541,7 +541,7 @@ MakeAboutPage()
   GtkWidget *logo;
   GtkWidget *ebox;
   GtkWidget *button;
-  char versionbuf[20];
+  char versionbuf[32]; /* Fixes crash with LANG=ja_JP (ja.po) at startup */
 
   aboutpage=MakeNewPage(uinfo->notebook,_("About"));
 
The warning:

launch.c:249: warning: passing argument 4 of 'g_locale_from_utf8' from incompatible pointer type

was critical. It appeared at: x86_64, ia64, ppc64, s390, s390x

On these machines, gsize is obviosly not defined as "int" but as different
value, on 64-bit machine it is certainly a 64-bit type. Only a differing
size of the pointer is an issue at this use of the variable.

Fixing it fixes the crash at start encoding on x86_64:

--- src/launch.c	2006/03/22 11:27:42	1.1
+++ src/launch.c	2006/03/22 11:28:02
@@ -243,7 +243,7 @@ void ArgsToLocale(GString **args)
   char *new_str;
   GString *new_arg;
   int pos;
-  int len;
+  gsize len;
 
   for(pos=1;args[pos];pos++) {
     new_str=g_locale_from_utf8(args[pos]->str,-1,NULL,&len,NULL);

The line above is the only use of "len", being the wrong type
caused data corruption or prevented this function from working
correctly and grip crashed shortly afterwards on x86_64.
openSUSE Build Service is sponsored by