]> granicus.if.org Git - nethack/commit
fix sym_val() buffer overrun
authorPatR <rankin@nethack.org>
Tue, 14 Jan 2020 10:05:14 +0000 (02:05 -0800)
committerPatR <rankin@nethack.org>
Tue, 14 Jan 2020 10:05:14 +0000 (02:05 -0800)
commit74de7d31e0a6b3e2ebd852e333fe66d212fd6a90
tree4586fa38b5cbffb187f39056f5a4434eee5a0569
parenta842fda44c612cd9a126c3039a575da92c6ee0f4
fix sym_val() buffer overrun

Fix 'Bug 3' where too long SYMBOL=string in run-time config file could
overflow a local buffer and clobber the stack.

Valid value is only one character long after processing an 'escaped'
encoded character which can be at most 6 characters (plus terminator):
backslash M backslash and up three digits.  If/when UTF8 gets added
the number of digits will increase.  Use a truncated copy of the input
(substantially bigger than 6+1); ignore any excess.
doc/fixes36.5
src/options.c