From: Michael Sterrett Date: Tue, 18 May 2010 17:49:21 +0000 (+0000) Subject: fix memory corruption bug; change HOMEPAGE (bug #320389) X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=9369757de76706f5ff654148531920f67f5d132d;p=gentoo.git fix memory corruption bug; change HOMEPAGE (bug #320389) Package-Manager: portage-2.1.8.3/cvs/Linux i686 --- diff --git a/games-puzzle/concentration/ChangeLog b/games-puzzle/concentration/ChangeLog index c2da741efd8d..fb3405c0c245 100644 --- a/games-puzzle/concentration/ChangeLog +++ b/games-puzzle/concentration/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for games-puzzle/concentration -# Copyright 2000-2007 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/games-puzzle/concentration/ChangeLog,v 1.8 2007/03/13 14:05:17 nyhm Exp $ +# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/games-puzzle/concentration/ChangeLog,v 1.9 2010/05/18 17:49:21 mr_bones_ Exp $ + +*concentration-1.2-r1 (18 May 2010) + + 18 May 2010; Michael Sterrett + +concentration-1.2-r1.ebuild, +files/concentration-1.2-gentoo.patch: + fix memory corruption bug; change HOMEPAGE (bug #320389) 13 Mar 2007; Tristan Heaven concentration-1.2.ebuild: Install menu entry, bug #159852 diff --git a/games-puzzle/concentration/Manifest b/games-puzzle/concentration/Manifest index b4347448c065..a5bb0ba7add5 100644 --- a/games-puzzle/concentration/Manifest +++ b/games-puzzle/concentration/Manifest @@ -1,4 +1,6 @@ +AUX concentration-1.2-gentoo.patch 4615 RMD160 28dccb8e8682854e755a88191ec0e3238cc8a804 SHA1 810234b72e99b6f370486a25bf6c500d47ee6644 SHA256 98cd9a33692785945515630738d4b3aa15bc1a3a9b0218778b32cddbcdbbe343 DIST concentration-1.2.tar.gz 1044563 RMD160 44c0950ce5b36c1317468c3e17a59c54e3bb3e49 SHA1 a5276546ba360a17eead74877caa66051a262b1f SHA256 f247fa694c03bc0a2be91bf85fed8c0f44447d0e7216b2d22259713453596ce8 +EBUILD concentration-1.2-r1.ebuild 842 RMD160 66e902540d8b8ad3fef9b5e49b834d2f40943aed SHA1 37b15b7af93ec4f7f682cb43374efc489eadd587 SHA256 2302bfc2b5c12edb63e21d9a921942a35ad63293380715f64e6bf136d3197f0b EBUILD concentration-1.2.ebuild 765 RMD160 dfe296024afd43be981df7623efb535dfda4cd8a SHA1 d58370fb38c0db282ea97022792de5c9fcf10b08 SHA256 ddefac55d0e8123ead5adce9e9008f6a144813fa043f3026890bf1d25afd787e -MISC ChangeLog 1058 RMD160 fea85a1509f622203279ca6885fa0e575617dfb1 SHA1 4f4169da6ef4185e0c5c67f6d2c8da6db384eed5 SHA256 db752fa8bcc0723a05b937cccee8ea4a6c209aa3f954181a497cce3f96f84cb1 +MISC ChangeLog 1286 RMD160 9d31efaed14672d8eba2c6695125e19af9ad1ff4 SHA1 d026b7357f9c9d7328263a8293652932569a524d SHA256 b2d8ada4bb8b468ac36bde5853cc384392105d62e968e389e12a5e96d9d564ab MISC metadata.xml 158 RMD160 cbd9984bb6b426c8c9cee5022fe0a26261612fea SHA1 be5251fa1dacef5c41b74761bb1c8c54fb633b9e SHA256 1423a4fdd4a79b1728a2056d9e300f7e1074253095d82726218d9e9b953888a3 diff --git a/games-puzzle/concentration/concentration-1.2-r1.ebuild b/games-puzzle/concentration/concentration-1.2-r1.ebuild new file mode 100644 index 000000000000..98b90e40c706 --- /dev/null +++ b/games-puzzle/concentration/concentration-1.2-r1.ebuild @@ -0,0 +1,30 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/games-puzzle/concentration/concentration-1.2-r1.ebuild,v 1.1 2010/05/18 17:49:21 mr_bones_ Exp $ + +EAPI=2 +inherit eutils games + +DESCRIPTION="The classic memory game with some new life" +HOMEPAGE="http://www.happypenguin.org/show?Concentration" +SRC_URI="mirror://gentoo/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~x86" +IUSE="" + +DEPEND="media-libs/libsdl[audio,video] + media-libs/sdl-mixer[vorbis] + media-libs/sdl-image[png] + media-libs/sdl-ttf" + +PATCHES=( "${FILESDIR}"/${P}-gentoo.patch ) + +src_install() { + emake DESTDIR="${D}" install || die "emake install failed" + newicon pics/set1/19.png ${PN}.png + make_desktop_entry ${PN} Concentration + dodoc AUTHORS ChangeLog + prepgamesdirs +} diff --git a/games-puzzle/concentration/files/concentration-1.2-gentoo.patch b/games-puzzle/concentration/files/concentration-1.2-gentoo.patch new file mode 100644 index 000000000000..759d068b5bae --- /dev/null +++ b/games-puzzle/concentration/files/concentration-1.2-gentoo.patch @@ -0,0 +1,155 @@ +diff -ru concentration-1.2.orig/src/ShiftyEngine.c concentration-1.2/src/ShiftyEngine.c +--- concentration-1.2.orig/src/ShiftyEngine.c 2004-09-20 21:08:59.000000000 -0400 ++++ concentration-1.2/src/ShiftyEngine.c 2010-05-18 13:39:22.717713130 -0400 +@@ -61,13 +61,13 @@ + int len = strlen(name); + assert(name); + +- gameName = (char *)malloc((sizeof(char) * len) + 1); ++ gameName = malloc(len + 1); + if(!gameName) { + fprintf(stderr, "Out Of Memory."); + exit(1); + } + +- strncpy(gameName, name, len); ++ snprintf(gameName, len + 1, "%s", name); + } + + /***************************************************** +@@ -87,13 +87,13 @@ + int len = strlen(name); + assert(name); + +- backgroundName = (char *)malloc((sizeof(char) * len) + 1); ++ backgroundName = malloc(len + 1); + if(!backgroundName) { + fprintf(stderr, "Out Of Memory."); + exit(1); + } + +- strncpy(backgroundName, name, len); ++ snprintf(backgroundName, len + 1, "%s", name); + } + + /***************************************************** +@@ -175,7 +175,7 @@ + exit(1); + } + +- strncpy(t->name, name, 16); ++ snprintf(t->name, 16, "%s", name); + t->x = x; + t->y = y; + t->w = w; +diff -ru concentration-1.2.orig/src/concentration.c concentration-1.2/src/concentration.c +--- concentration-1.2.orig/src/concentration.c 2005-11-09 11:05:02.000000000 -0500 ++++ concentration-1.2/src/concentration.c 2010-05-18 13:42:19.688474410 -0400 +@@ -202,7 +202,7 @@ + + /***************************************************** + ****************************************************/ +-inline void drawText(char * str, SDL_Color color, int x, int y, TTF_Font * font) ++void drawText(char * str, SDL_Color color, int x, int y, TTF_Font * font) + { + static SDL_Rect dest; + +@@ -814,7 +814,7 @@ + SE_Error("A blit failed."); + SDL_FreeSurface(text); + +- sprintf(str, "%d seconds", myclock); ++ snprintf(str, sizeof(str), "%d seconds", myclock); + text = TTF_RenderText_Blended(smallFont, str, black); + if(!text) + SE_Error("A render failed."); +@@ -831,7 +831,7 @@ + SE_Error("A blit failed."); + SDL_FreeSurface(text); + +- sprintf(str, "%d trys", hits + misses); ++ snprintf(str, sizeof(str), "%d trys", hits + misses); + text = TTF_RenderText_Blended(smallFont, str, black); + if(!text) + SE_Error("A render failed."); +@@ -840,7 +840,7 @@ + SE_Error("A blit failed."); + SDL_FreeSurface(text); + +- sprintf(str, "Total pairs: %d", (size == 2) ? 2 : (size == 4) ? 8 : 36); ++ snprintf(str, sizeof(str), "Total pairs: %d", (size == 2) ? 2 : (size == 4) ? 8 : 36); + text = TTF_RenderText_Blended(smallFont, str, black); + if(!text) + SE_Error("A render failed."); +@@ -1327,7 +1327,7 @@ + { + int x, makeFullScreen = 0; + +- char name[16]; ++ char name[64]; + + SE_SetName("Concentration 1.2"); + SE_SetBackground("pics/background.png"); +@@ -1395,13 +1395,13 @@ + + /* load icon set 1 */ + for(x = 1; x <= 30; x++) { +- sprintf(name, "pics/set1/%d.png", x); ++ snprintf(name, sizeof(name), "pics/set1/%d.png", x); + icons[x] = loadPNG(name); + +- sprintf(name, "pics/set2/%d.png", x); ++ snprintf(name, sizeof(name), "pics/set2/%d.png", x); + icons2[x] = loadPNG(name); + +- sprintf(name, "pics/set3/%d.png", x); ++ snprintf(name, sizeof(name), "pics/set3/%d.png", x); + icons3[x] = loadPNG(name); + } + +diff -ru concentration-1.2.orig/src/gfx.c concentration-1.2/src/gfx.c +--- concentration-1.2.orig/src/gfx.c 2004-09-20 21:08:59.000000000 -0400 ++++ concentration-1.2/src/gfx.c 2010-05-18 13:39:22.718722669 -0400 +@@ -39,8 +39,7 @@ + exit(1); + } + +- strcpy(newname, sg_data_path); +- strcat(newname, name); ++ snprintf(newname, len1 + len2 + 1, "%s%s", sg_data_path, name); + + temp = IMG_Load(newname); + if (temp == NULL) { +@@ -67,8 +66,7 @@ + exit(1); + } + +- strcpy(newname, sg_data_path); +- strcat(newname, name); ++ snprintf(newname, len1 + len2 + 1, "%s%s", sg_data_path, name); + + temp = IMG_Load(newname); + if (temp == NULL) { +@@ -99,8 +97,7 @@ + exit(1); + } + +- strcpy(newname, sg_data_path); +- strcat(newname, name); ++ snprintf(newname, len1 + len2 + 1, "%s%s", sg_data_path, name); + + temp = TTF_OpenFont(newname, size); + if (temp == NULL) { +diff -ru concentration-1.2.orig/src/sound.c concentration-1.2/src/sound.c +--- concentration-1.2.orig/src/sound.c 2004-09-20 21:08:59.000000000 -0400 ++++ concentration-1.2/src/sound.c 2010-05-18 13:39:22.718722669 -0400 +@@ -57,8 +57,7 @@ + fprintf(stderr, "Out of memory!\n"); + exit(1); + } +- strcpy(newname, sg_data_path); +- strcat(newname, name); ++ snprintf(newname, len1 + len2 + 1, "%s%s", sg_data_path, name); + + temp = Mix_LoadWAV(newname); + if(!temp)