[packages/allegro] - added format patch (fixes build with -Werror=format-security) - fixed man-prefix patch

qboosh qboosh at pld-linux.org
Sun Mar 31 18:33:13 CEST 2013


commit a2b303efbbe07e97caa1f97669c5f156ca2bd54a
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sun Mar 31 18:33:00 2013 +0200

    - added format patch (fixes build with -Werror=format-security)
    - fixed man-prefix patch

 allegro-format.patch     | 100 +++++++++++++++++++++++++++++++++++++++++++++++
 allegro-man-prefix.patch |   2 +-
 allegro.spec             |   2 +
 3 files changed, 103 insertions(+), 1 deletion(-)
---
diff --git a/allegro.spec b/allegro.spec
index 10c6e97..a5472b1 100644
--- a/allegro.spec
+++ b/allegro.spec
@@ -26,6 +26,7 @@ Source0:	http://downloads.sourceforge.net/alleg/%{name}-%{version}.tar.gz
 Patch0:		%{name}-info.patch
 Patch1:		%{name}-config.patch
 Patch2:		%{name}-man-prefix.patch
+Patch3:		%{name}-format.patch
 URL:		http://alleg.sourceforge.net/
 BuildRequires:	OpenGL-GLU-devel
 BuildRequires:	OpenGL-devel
@@ -341,6 +342,7 @@ biblioteki allegro.
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
+%patch3 -p1
 
 %{__sed} -i -e 's/ADDON_LINKAGE STATIC/ADDON_LINKAGE SHARED/' CMakeLists.txt
 
diff --git a/allegro-format.patch b/allegro-format.patch
new file mode 100644
index 0000000..2baed67
--- /dev/null
+++ b/allegro-format.patch
@@ -0,0 +1,100 @@
+--- allegro-4.4.2/src/unix/umodules.c.orig	2011-05-13 10:11:33.000000000 +0200
++++ allegro-4.4.2/src/unix/umodules.c	2013-03-31 15:38:10.240570677 +0200
+@@ -126,11 +126,11 @@
+ 	 continue;
+ 
+       if (!fullpath_slash) {
+-         snprintf(fullpath, sizeof fullpath, filename);
++         snprintf(fullpath, sizeof fullpath, "%s", filename);
+ 	 fullpath[(sizeof fullpath) - 1] = 0;
+       }
+       else {
+-	 snprintf(fullpath_slash+1, (sizeof fullpath) - (fullpath_slash - fullpath) - 1, filename);
++	 snprintf(fullpath_slash+1, (sizeof fullpath) - (fullpath_slash - fullpath) - 1, "%s", filename);
+ 	 fullpath[(sizeof fullpath) - 1] = 0;
+       }
+       
+--- allegro-4.4.2/src/linux/ljoy.c.orig	2010-02-20 06:18:16.000000000 +0100
++++ allegro-4.4.2/src/linux/ljoy.c	2013-03-31 16:10:01.382066535 +0200
+@@ -93,7 +93,7 @@
+ 
+       if (ioctl(joy_fd[i], JSIOCGVERSION, &raw_version) < 0) {
+          /* NOTE: IOCTL fails if the joystick API is version 0.x */
+-         uszprintf(allegro_error, ALLEGRO_ERROR_SIZE, get_config_text("Your Linux joystick API is version 0.x which is unsupported."));
++         uszprintf(allegro_error, ALLEGRO_ERROR_SIZE, "%s", get_config_text("Your Linux joystick API is version 0.x which is unsupported."));
+          return -1; 
+       }
+       
+--- allegro-4.4.2/examples/exkeys.c.orig	2008-01-10 20:46:00.000000000 +0100
++++ allegro-4.4.2/examples/exkeys.c	2013-03-31 17:08:24.133321018 +0200
+@@ -193,7 +193,7 @@
+       if (key_shifts & KB_NUMLOCK_FLAG)  strcat(buf, " num");
+       if (key_shifts & KB_SCROLOCK_FLAG) strcat(buf, " scrl");
+       scroll();
+-      textprintf_ex(screen, font, 8, SCREEN_H-16, makecol(0, 0, 0), makecol(255, 255, 255), buf);
++      textprintf_ex(screen, font, 8, SCREEN_H-16, makecol(0, 0, 0), makecol(255, 255, 255), "%s", buf);
+    } while (k != 27);
+ 
+    /* various scan codes are defined in allegro.h as KEY_* constants */
+@@ -234,7 +234,7 @@
+       if (key[KEY_8]) buf[8] = '8'; else buf[8] = ' ';
+       if (key[KEY_9]) buf[9] = '9'; else buf[9] = ' ';
+       buf[10] = 0;
+-      textprintf_ex(screen, font, 8, SCREEN_H-16, makecol(0, 0, 0), makecol(255, 255, 255), buf);
++      textprintf_ex(screen, font, 8, SCREEN_H-16, makecol(0, 0, 0), makecol(255, 255, 255), "%s", buf);
+       rest(1);
+    } while (!keypressed() || (readkey() >> 8) != KEY_ESC);
+ 
+--- allegro-4.4.2/examples/extrans2.c.orig	2008-01-30 11:56:50.000000000 +0100
++++ allegro-4.4.2/examples/extrans2.c	2013-03-31 17:12:57.722608195 +0200
+@@ -211,7 +211,7 @@
+       } else {
+          msg = "no flipping";
+       }
+-      textprintf_ex(buffer, font, 1, 1, makecol(255, 255, 255), -1, msg);
++      textprintf_ex(buffer, font, 1, 1, makecol(255, 255, 255), -1, "%s", msg);
+ 
+       /* finally blit the back buffer on the screen */
+       blit(buffer, screen, 0, 0, 0, 0, buffer->w, buffer->h);
+--- allegro-4.4.2/tools/pack.c.orig	2006-05-20 16:49:58.000000000 +0200
++++ allegro-4.4.2/tools/pack.c	2013-03-31 17:43:56.811562844 +0200
+@@ -42,7 +42,7 @@
+       printf(": %s", s1);
+ 
+    if (s2)
+-      printf(s2);
++      fputs(s2, stdout);
+ 
+    printf("\n");
+ 
+--- allegro-4.4.2/setup/setup.c.orig	2010-05-23 18:05:33.000000000 +0200
++++ allegro-4.4.2/setup/setup.c	2013-03-31 18:03:16.278298378 +0200
+@@ -1163,7 +1163,7 @@
+ 	 textprintf_ex(bmp, font, SCREEN_W/2-96, SCREEN_H/2-60+c*20, -1, -1, uconvert_ascii("%s (%d/%d)", tmp),
+                     joystick_driver->name, i+1, num_joysticks);
+       else
+-	 textprintf_ex(bmp, font, SCREEN_W/2-96, SCREEN_H/2-60+c*20, -1, -1, joystick_driver->name);
++	 textprintf_ex(bmp, font, SCREEN_W/2-96, SCREEN_H/2-60+c*20, -1, -1, "%s", joystick_driver->name);
+       c++;
+    }
+ 
+@@ -2879,7 +2879,7 @@
+       alert(uconvert_ascii("Error loading " SETUP_DATA_FILE, tmp1), NULL, NULL, uconvert_ascii("OK", tmp2), NULL, 13, 0);
+     #else
+       set_gfx_mode(GFX_TEXT, 0, 0, 0, 0);
+-      allegro_message(uconvert_ascii("Error loading " SETUP_DATA_FILE "\n", tmp1));
++      allegro_message("%s", uconvert_ascii("Error loading " SETUP_DATA_FILE "\n", tmp1));
+     #endif
+       return 1;
+    }
+--- allegro-4.4.2/tests/play.c.orig	2005-03-19 12:15:07.000000000 +0100
++++ allegro-4.4.2/tests/play.c	2013-03-31 18:04:24.698120328 +0200
+@@ -74,7 +74,7 @@
+ 
+    strcat(msg, "\nIf you don't specify the card, Allegro will auto-detect (ie. guess :-)\n");
+ 
+-   allegro_message(msg);
++   allegro_message("%s", msg);
+    free(msg);
+ }
+ 
diff --git a/allegro-man-prefix.patch b/allegro-man-prefix.patch
index 904d875..eef0a77 100644
--- a/allegro-man-prefix.patch
+++ b/allegro-man-prefix.patch
@@ -43,7 +43,7 @@
  			   return 1;
  
 -			fprintf(f2, ".so man%s/%s\n", get_extension(filename), get_filename(buf));
-+			fprintf(f2, ".so man%s/allegro-%s\n", get_extension(filename), get_filename(buf));
++			fprintf(f2, ".so man%s/%s\n", get_extension(filename), get_filename(buf));
  			fclose(f2);
  		     }
  
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/allegro.git/commitdiff/a2b303efbbe07e97caa1f97669c5f156ca2bd54a



More information about the pld-cvs-commit mailing list