diff options
author | Tianhao Chai <cth451@gmail.com> | 2018-03-09 19:04:44 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-03-13 17:38:12 (GMT) |
commit | 7899e5369126599aa05689b9ddfd233d2f317910 (patch) | |
tree | deedc6332e902627649bdbcf2517abb804faf643 /Source/CursesDialog | |
parent | c1e087a9d3af74299d7681c9f9de59e5977a1539 (diff) | |
download | CMake-7899e5369126599aa05689b9ddfd233d2f317910.zip CMake-7899e5369126599aa05689b9ddfd233d2f317910.tar.gz CMake-7899e5369126599aa05689b9ddfd233d2f317910.tar.bz2 |
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.
Diffstat (limited to 'Source/CursesDialog')
-rw-r--r-- | Source/CursesDialog/cmCursesMainForm.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index dbd024d..4a9dc47 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)); } } } |