From e21a5c6ac37095c1d4062c8488ee976b55e2d086 Mon Sep 17 00:00:00 2001 From: PatR Date: Sun, 20 Apr 2025 14:19:40 -0700 Subject: [PATCH] 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. --- win/curses/cursmisc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/win/curses/cursmisc.c b/win/curses/cursmisc.c index 42dd6250b..ce02ca435 100644 --- a/win/curses/cursmisc.c +++ b/win/curses/cursmisc.c @@ -343,7 +343,12 @@ curses_break_str(const char *str, int width, int line_num) } if (curline < line_num) { +#if 0 return NULL; +#else + /* callers aren't prepared to handle NULL return */ + Strcpy(curstr, ""); +#endif } retstr = curses_copy_of(curstr);