curses band-aid
heaputil reported an attempt to free a null pointer at line 1314 of cursdial.c (in menu_display_page()). curses_break_str() can return Null but its callers aren't prepared for that. Make it return an empty string that can be passed to free() instead.
This commit is contained in:
@@ -343,7 +343,12 @@ curses_break_str(const char *str, int width, int line_num)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (curline < line_num) {
|
if (curline < line_num) {
|
||||||
|
#if 0
|
||||||
return NULL;
|
return NULL;
|
||||||
|
#else
|
||||||
|
/* callers aren't prepared to handle NULL return */
|
||||||
|
Strcpy(curstr, "");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
retstr = curses_copy_of(curstr);
|
retstr = curses_copy_of(curstr);
|
||||||
|
|||||||
Reference in New Issue
Block a user