[nethack] 02/02: Avoid crash when using long lines in nethackrc. (Closes: #819337)

James Cowgill jcowgill-guest at moszumanska.debian.org
Sat Mar 26 23:57:16 UTC 2016


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

jcowgill-guest pushed a commit to branch master
in repository nethack.

commit e2de5fc46c6a2743f75d9bb06e9d7141390bade9
Author: James Cowgill <james410 at cowgill.org.uk>
Date:   Sat Mar 26 23:56:45 2016 +0000

    Avoid crash when using long lines in nethackrc. (Closes: #819337)
---
 debian/patches/series                              |  1 +
 ...1-avoid-crash-for-long-lines-in-nethackrc.patch | 27 ++++++++++++++++++++++
 2 files changed, 28 insertions(+)

diff --git a/debian/patches/series b/debian/patches/series
index 4a93708..8111482 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
+u1-avoid-crash-for-long-lines-in-nethackrc.patch
 0001-Make-sure-the-user-calling-recover-owns-the-file.patch
 0002-Change-paths-in-the-default-manpage-to-what-is-used-.patch
 0004-Add-LISP-based-windowing-system.patch
diff --git a/debian/patches/u1-avoid-crash-for-long-lines-in-nethackrc.patch b/debian/patches/u1-avoid-crash-for-long-lines-in-nethackrc.patch
new file mode 100644
index 0000000..bee795b
--- /dev/null
+++ b/debian/patches/u1-avoid-crash-for-long-lines-in-nethackrc.patch
@@ -0,0 +1,27 @@
+From 288ac4b07c82bcd40d8f54fa0063a854e3c65a77 Mon Sep 17 00:00:00 2001
+From: David Cohrs <davecohrs at gmail.com>
+Date: Thu, 28 Jan 2016 18:38:53 -0800
+Subject: [PATCH] avoid crash for long lines in nethackrc
+
+read_config_file() has used a buffer of size (4 * BUFSZ) since 3.4.x
+so parse_config_line() needs a buffer of the same size to avoid
+buffer overrun. Allows my old .nethackrc to work again.
+
+[jcowgill: remove changelog changes]
+
+diff --git a/src/files.c b/src/files.c
+index c367e6d..f8a7672 100644
+--- a/src/files.c
++++ b/src/files.c
+@@ -2100,7 +2100,7 @@ int src;
+ #ifdef SYSCF
+     int n;
+ #endif
+-    char *bufp, *altp, buf[BUFSZ];
++    char *bufp, *altp, buf[4 * BUFSZ];
+     uchar translate[MAXPCHARS];
+     int len;
+ 
+-- 
+2.8.0.rc3
+

-- 
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