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.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 files.c $NHDT-Date: 1452992318 2016/01/17 00:58:38 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.201 $ */
|
||||
/* NetHack 3.6 files.c $NHDT-Date: 1454035130 2016/01/29 02:38:50 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.202 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user