From 7899e5369126599aa05689b9ddfd233d2f317910 Mon Sep 17 00:00:00 2001 From: Tianhao Chai Date: Fri, 9 Mar 2018 13:04:44 -0600 Subject: [PATCH] ccmake: fix status line buffer overflow on very wide terminals A mistyped length calculation will memset across stack frame when the user's terminal width is larger than 270. --- Source/CursesDialog/cmCursesMainForm.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index dbd024da61..4a9dc473cb 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -475,7 +475,7 @@ void cmCursesMainForm::UpdateStatusBar(const char* message) strncpy(bar + curFieldLen + 2, help, width - curFieldLen - 2); if (curFieldLen + helpLen + 2 < width) { memset(bar + curFieldLen + helpLen + 2, ' ', - width - curFieldLen + helpLen + 2); + width - (curFieldLen + helpLen + 2)); } } }