InfoScreen: fix uncontrolled format string

mvwprintw takes a format string as its fourth argument, and title is
user-controlled. This results in e.g. crashing when trying to trace a
process with a format specifier in its command line.
This commit is contained in:
V 2021-01-08 05:11:45 +01:00 committed by cgzones
parent 27db9297b7
commit bfcb8ca019
1 changed files with 1 additions and 1 deletions

View File

@ -54,7 +54,7 @@ void InfoScreen_drawTitled(InfoScreen* this, const char* fmt, ...) {
attrset(CRT_colors[METER_TEXT]); attrset(CRT_colors[METER_TEXT]);
mvhline(0, 0, ' ', COLS); mvhline(0, 0, ' ', COLS);
mvwprintw(stdscr, 0, 0, title); mvaddstr(0, 0, title);
attrset(CRT_colors[DEFAULT_COLOR]); attrset(CRT_colors[DEFAULT_COLOR]);
Panel_draw(this->display, true, true, true, false); Panel_draw(this->display, true, true, true, false);