From: PatR Date: Sun, 2 Dec 2018 00:43:13 +0000 (-0800) Subject: debug_fuzzer vs '!' and ^Z X-Git-Tag: nmake-explicit-path~100 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f12565398a90579747fce6144cc80074e1b1e5ac;p=nethack debug_fuzzer vs '!' and ^Z My sysconf allows shell escape, and the fuzzer seems fond of that. Suppress '!' and also '^Z', although I didn't notice it execute the latter. Without this hack, the sequence '!', sub-shell exit, '&' causes nethack to be killed via SIGTTOU while fiddling with terminal settings for introff(). --- diff --git a/src/cmd.c b/src/cmd.c index d59e9b87a..a7f37ae25 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 cmd.c $NHDT-Date: 1542673290 2018/11/20 00:21:30 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.302 $ */ +/* NetHack 3.6 cmd.c $NHDT-Date: 1543711385 2018/12/02 00:43:05 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.309 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2013. */ /* NetHack may be freely redistributed. See license for details. */ @@ -5501,6 +5501,12 @@ parse() alt_esc = FALSE; /* readchar() reset */ #endif + if (iflags.debug_fuzzer /* if fuzzing, override '!' and ^Z */ + && (Cmd.commands[foo & 0x0ff] + && (Cmd.commands[foo & 0x0ff]->ef_funct == dosuspend_core + || Cmd.commands[foo & 0x0ff]->ef_funct == dosh))) + foo = Cmd.spkeys[NHKF_ESC]; + if (foo == Cmd.spkeys[NHKF_ESC]) { /* esc cancels count (TH) */ clear_nhwindow(WIN_MESSAGE); multi = last_multi = 0;