games-server/crossfire-server: Fix format security. Bug #544352
authorTupone Alfredo <tupone@gentoo.org>
Tue, 15 Dec 2015 20:46:09 +0000 (21:46 +0100)
committerTupone Alfredo <tupone@gentoo.org>
Tue, 15 Dec 2015 20:46:43 +0000 (21:46 +0100)
Package-Manager: portage-2.2.24

games-server/crossfire-server/crossfire-server-1.71.0.ebuild
games-server/crossfire-server/files/crossfire-server-1.71.0-format.patch [new file with mode: 0644]

index e0c191859bfd482aa4a4f0f98b86e57220551dea..06055ecb7ab276ff5d53e08accafe41cc26f83e0 100644 (file)
@@ -28,6 +28,7 @@ RDEPEND=${DEPEND}
 src_prepare() {
        rm -f "${WORKDIR}"/maps/Info/combine.pl # bug #236205
        ln -s "${WORKDIR}/arch" "${S}/lib" || die
+       epatch "${FILESDIR}"/${P}-format.patch
 }
 
 src_configure() {
diff --git a/games-server/crossfire-server/files/crossfire-server-1.71.0-format.patch b/games-server/crossfire-server/files/crossfire-server-1.71.0-format.patch
new file mode 100644 (file)
index 0000000..174b785
--- /dev/null
@@ -0,0 +1,20 @@
+--- server/c_chat.c.old        2015-12-15 21:35:30.024866220 +0100
++++ server/c_chat.c    2015-12-15 21:36:58.479266312 +0100
+@@ -483,7 +483,7 @@
+     { "You spit over your left shoulder.", "%s spits over his left shoulder." },
+     { "Strut your stuff.", "%s struts proudly." },
+     { NULL, NULL },
+-    { "%s patiently twiddles his thumbs.", "You patiently twiddle your thumbs." },
++    { "You patiently twiddle your thumbs.", "%s patiently twiddles his thumbs." },
+     { "You wave.", "%s waves happily." },
+     { "You whistle appreciatively.", "%s whistles appreciatively." },
+     { "Have you got something in your eye?", "%s winks suggestively." },
+@@ -645,7 +645,7 @@
+ 
+     if (*params == '\0') {
+         if (emotion > EMOTE_FIRST && emotion < EMOTE_LAST && single_emotes[emotion - 1][0] != NULL) {
+-            snprintf(buf, sizeof(buf), single_emotes[emotion - 1][0]);
++            snprintf(buf, sizeof(buf), "%s", single_emotes[emotion - 1][0]);
+             snprintf(buf2, sizeof(buf2), single_emotes[emotion - 1][1], op->name);
+         } else {
+             snprintf(buf, sizeof(buf), "You are a nut.");