Solène Rapenne <[email protected]> writes:

> Le 2016-11-24 05:14, Jeremie Courreges-Anglas a écrit :
>> Solène Rapenne <[email protected]> writes:
>>
>>> There is a bug in games/slash which can be annoying, I'm
>>> using -current
>>> at the moment of this mail. When you start the game and you want to
>>> choose your character, whatever your pick, the game ends with abort
>>> trap
>>> like this (where I pick A) =>
>>>
>>>> An Archeologist, a Barbarian, a Caveman, [..], or a Wizard?
>>>>   [A,B,C,D,E,F,G,H,I,K,L,M,N,P,R,S,T,U,V,W, or Q] AAbort trap
>>>
>>> This does not simply stop the games (no process alive), it creates a
>>> file named {a,b,c,d}lock.0 in the game dir. Once you reach a 4rd game
>>> lock, the game will tell you that you "Too many hacks running now."
>>> and
>>> you can't play until you remove the .0 files.
>>
>> It's a stack buffer overflow, the problem is that a 128 bytes buffer is
>> used to build a string that spans the terminal width.  The crash
>> doesn't
>> trigger with a small terminal here, nor with the following patch.  1024
>> columns ought to be enough for anybody.

[...]

> Your patch fix my issue :-)
>
> Also, it seems that ftp.nethack.org doesn't exist anymore, the hostname
> is not resolvable

Indeed, sourceforge can be used here.  The tarball name changes, the
checksum stays the same.  I haven't found a mirror for Slash-Unix.tar.gz
yet.

Marc, objections?


Index: Makefile
===================================================================
RCS file: /d/cvs/ports/games/slash/Makefile,v
retrieving revision 1.46
diff -u -p -r1.46 Makefile
--- Makefile    31 Mar 2015 09:44:48 -0000      1.46
+++ Makefile    27 Nov 2016 10:52:31 -0000
@@ -4,18 +4,14 @@ COMMENT =     dungeon explorin', hackin' gam
 
 DISTNAME =     slash-e8
 PKGNAME =      slash-3.2.2.e8
-REVISION =     4
+REVISION =     5
 CATEGORIES =   games
 
-MASTER_SITES = ftp://ftp.nethack.org/pub/nethack/oldver/3.2.2/src/ \
-               ftp://ftp.uu.net/pub/games/nethack/sources/ \
-               ${MASTER_SITE_GNU:=nethack/}
+MASTER_SITES = ${MASTER_SITE_SOURCEFORGE:=nethack/}
+MASTER_SITES0 =        http://www.rz.tu-ilmenau.de/~wi019/Slash/
 
-MASTER_SITES0 =        ftp://ftp.nethack.org/pub/nethack/oldver/3.2.3/src/
-MASTER_SITES1 =        http://www.rz.tu-ilmenau.de/~wi019/Slash/
-
-DISTFILES =    nethack-3.2.2.tar.gz Slash-Unix.tar.gz:1
-PATCHFILES =   nh-3.2.2-3.2.3.diff:0
+DISTFILES =    nethack-322.tgz Slash-Unix.tar.gz:0
+PATCHFILES =   nh-3.2.2-3.2.3.diff
 
 
 MAINTAINER =   Marc Espie <[email protected]>
Index: distinfo
===================================================================
RCS file: /d/cvs/ports/games/slash/distinfo,v
retrieving revision 1.4
diff -u -p -r1.4 distinfo
--- distinfo    18 Jan 2015 03:14:01 -0000      1.4
+++ distinfo    27 Nov 2016 10:58:16 -0000
@@ -1,6 +1,6 @@
 SHA256 (Slash-Unix.tar.gz) = x3yVGbG61GGhqAP364AgjGXVpSCYqw/YMtZGhGnPE64=
-SHA256 (nethack-3.2.2.tar.gz) = 9HDaOHDaqAS3Zmz5hhCn3pTawkVs2eGmEkswGyrQXag=
+SHA256 (nethack-322.tgz) = 9HDaOHDaqAS3Zmz5hhCn3pTawkVs2eGmEkswGyrQXag=
 SHA256 (nh-3.2.2-3.2.3.diff) = 4l7J7xhxgYuM9s32xMk92kLAI+u0ZP1GBZtfsNx4RXA=
 SIZE (Slash-Unix.tar.gz) = 347625
-SIZE (nethack-3.2.2.tar.gz) = 2617477
+SIZE (nethack-322.tgz) = 2617477
 SIZE (nh-3.2.2-3.2.3.diff) = 19733
Index: patches/patch-include_global_h
===================================================================
RCS file: patches/patch-include_global_h
diff -N patches/patch-include_global_h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-include_global_h      24 Nov 2016 02:51:17 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+Bump QBUFSZ to cope for large terminals and avoid stack buffer
+overflows.
+
+--- include/global.h.orig      Thu Nov 24 03:49:47 2016
++++ include/global.h   Thu Nov 24 03:50:14 2016
+@@ -297,7 +297,7 @@ struct version_info {
+ #define DOORMAX               120     /* max number of doors per level */
+ 
+ #define BUFSZ         256     /* for getlin buffers */
+-#define QBUFSZ                128     /* for building question text */
++#define QBUFSZ                1024    /* for building question text */
+ 
+ #define PL_NSIZ               32      /* name of player, ghost, shopkeeper */
+ #define PL_CSIZ               32      /* sizeof pl_character */

-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

Reply via email to