Fix bxconfigure crash on terminals wider than 200 columns.

A few places created strings based on the terminal width, using fixed-sized
buffers and without checking for overflowing them.  Fix those, and also
replace all other sprintf() calls with snprintf().

Reported by cpet.
This commit is contained in:
Kevin Easton
2015-06-19 20:42:44 +10:00
parent d0b0a95330
commit 1b1734d7e1
3 changed files with 50 additions and 35 deletions

View File

@@ -302,9 +302,9 @@ int ls_dispatch (CELL * c)
while (c -> termkey == 0/* && c->start*/) {
hit = FALSE;
if (c->redraw && ((*c -> ListPaintProc) != NULL))
if (c->redraw && (c->ListPaintProc != NULL))
(*c -> ListPaintProc) (c);
if (*c -> UpdateStatusProc != NULL)
if (c->UpdateStatusProc != NULL)
(*c -> UpdateStatusProc) (c);
if (c -> termkey == 0) {
if ((*c -> OtherGetKeyProc) != NULL && c->other_getkey)