[nethack] 01/01: Imported Debian patch 3.3.0-7potato1

James Cowgill jcowgill-guest at moszumanska.debian.org
Mon Mar 7 17:53:07 UTC 2016


This is an automated email from the git hooks/post-receive script.

jcowgill-guest pushed a commit to annotated tag debian/3.3.0-7potato1
in repository nethack.

commit 19f54f4b16f2d598ca221bf40c216e80da212922
Author: Matt Zimmerman <mdz at debian.org>
Date:   Sun May 25 17:07:57 2003 -0400

    Imported Debian patch 3.3.0-7potato1
---
 debian/changelog |  9 +++++++++
 debian/control   |  1 +
 src/topten.c     | 10 ++++++++--
 3 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index b2c4c50..3bf5ae2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+nethack (3.3.0-7potato1) oldstable-security; urgency=high
+
+  * Non-maintainer upload by the Security Team
+  * Fix buffer overflow in src/topten.c (#181854)
+  * Build-Depends: debhelper, libncurses5-dev, flex, bison, groff,
+    bsdmainutils, xlib6g-dev, xpm4g-dev, xbase-clients
+
+ -- Matt Zimmerman <mdz at debian.org>  Sun, 25 May 2003 17:07:57 -0400
+
 nethack (3.3.0-7) unstable; urgency=low
 
   * Patch to fix bones-file handling in /var/lib/games/nethack.
diff --git a/debian/control b/debian/control
index 24c3fbd..24f3279 100644
--- a/debian/control
+++ b/debian/control
@@ -3,6 +3,7 @@ Section: games
 Priority: optional
 Maintainer: Ben Gertzfield <che at debian.org>
 Standards-Version: 3.1.1.1
+Build-Depends: debhelper, libncurses5-dev, flex, bison, groff, bsdmainutils, xlib6g-dev, xpm4g-dev, xbase-clients
 
 Package: nethack
 Architecture: any
diff --git a/src/topten.c b/src/topten.c
index 91bd692..d3f0ff3 100644
--- a/src/topten.c
+++ b/src/topten.c
@@ -836,8 +836,14 @@ char **argv;
 	    if (playerct < 1) Strcat(pbuf, "you.");
 	    else {
 		if (playerct > 1) Strcat(pbuf, "any of ");
-		for (i = 0; i < playerct; i++) {
-		    Strcat(pbuf, players[i]);
+		for (i = 0; i < playerct && strlen(pbuf) < sizeof(pbuf) - 2; i++) {
+		    size_t len = strlen(pbuf), rest;
+		    if (strlen(players[i]) > sizeof(pbuf) - len - 2) {
+		        rest = sizeof(pbuf) - strlen(pbuf) - 2;
+			memcpy(pbuf + len, players[i], rest);
+			pbuf[len + rest] = '\0';
+		    } else
+		        Strcat(pbuf, players[i]);
 		    if (i < playerct-1) Strcat(pbuf, ":");
 		}
 	    }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/nethack.git



More information about the Pkg-games-commits mailing list