]> granicus.if.org Git - nethack/commit
option parsing crash: 'playmode' without value
authorPatR <rankin@nethack.org>
Fri, 5 Aug 2016 00:42:26 +0000 (17:42 -0700)
committerPatR <rankin@nethack.org>
Fri, 5 Aug 2016 00:42:26 +0000 (17:42 -0700)
commit694b32cae267134598465ce3d3483483a9dac848
tree1376a4c5a0b9506ba55178a545cc7bb9c71a12b7
parente03c14eeae10c4a49f933120722ac9329689d99a
option parsing crash: 'playmode' without value

Reported directly to devteam, specifying the playmode option without
appending a value caused a segfault during options parsing.  The
argument passed to string_for_opt() ought to have been False for
"not optional" to trigger a "bad syntax" message, but even then the
playmode parsing needs to check for Null to prevent the crash.

"Bad syntax" is awfully vague.  In cases like this, we can be more
precise.  Now it will say "Missing value" instead.
doc/fixes36.1
src/options.c