option parsing buffer overflow vulnerability
The report that parse_config_line() could overflow its buffer when passed a long value from parse_config_file() was already fixed for 3.6.1, but longer config lines mean that later stages of option parsing need to be aware of the possibility of lines longer than BUFSZ. This fixes the three special options which deal with regular expressions. Autopickup exceptions, message types, and menu coloring all could exceed BUFSZ when formatting a value to put in the menu for 'list' or 'remove' of existing entries. Menu colors could overflow by an arbitrary amount, message types by up to 13 bytes, and autopickup exceptions by just 1 byte. Both tty and X11 seem to cope with long menu entries (wider than can be displayed but not exceeding BUFSZ) by truncating. For menu colorings, that hides the color and highlight attribute since those are placed after the regexp. Menu line truncation for tty was straightforward, just chopped a big chunk off the end of the long string. For X11, it did that too, taking off a lot less but ending up with much of the menu hidden off the left edge of the screen. Dragging it into view showed that the width fit the whole screen (or possibly fit the width of the map, which was also as wide as the screen). So the initial position is being miscalculated.
This commit is contained in:
@@ -243,6 +243,9 @@ in baalz_fixup, move any monster away from the two fake pool spots
|
||||
switching farlook from xname to doname was giving away information for items
|
||||
located via object detection (quantity of detected gold)
|
||||
catch up win/Qt/qt_win.cpp on 18-Dec-2015 change to formatkiller()
|
||||
fix for long lines in config file (28-Jan-2016) made 'O' command's 'list' and
|
||||
'remove' menu choices in interactive handling for menu colorings,
|
||||
message types, and autopickup exceptions subject to buffer overflow
|
||||
|
||||
|
||||
Platform- and/or Interface-Specific Fixes
|
||||
|
||||
Reference in New Issue
Block a user