fix hunger status highlighting text match
Crash triggered by fuzzer. The Null value for not-hungry between "Satiated" and "Hungry" in the array of possible hunger states caused a crash if C++ regex handling was being used. With posixregex, it would pass benignly for tty but crash for curses. I didn't check any other interface.
This commit is contained in:
@@ -1797,6 +1797,12 @@ add_menu(
|
||||
const char *str, /* menu text */
|
||||
unsigned int itemflags) /* itemflags such as MENU_ITEMFLAGS_SELECTED */
|
||||
{
|
||||
if (!str) {
|
||||
/* if 'str' is Null, just return without adding any menu entry */
|
||||
debugpline0("add_menu(Null)");
|
||||
return;
|
||||
}
|
||||
|
||||
if (iflags.use_menu_color) {
|
||||
if ((itemflags & MENU_ITEMFLAGS_SKIPMENUCOLORS) == 0)
|
||||
(void) get_menu_coloring(str, &color, &attr);
|
||||
|
||||
Reference in New Issue
Block a user