summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorTianhao Chai <cth451@gmail.com>2018-03-09 19:04:44 (GMT)
committerBrad King <brad.king@kitware.com>2018-03-13 17:38:12 (GMT)
commit7899e5369126599aa05689b9ddfd233d2f317910 (patch)
treedeedc6332e902627649bdbcf2517abb804faf643 /Source
parentc1e087a9d3af74299d7681c9f9de59e5977a1539 (diff)
downloadCMake-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')
-rw-r--r--Source/CursesDialog/cmCursesMainForm.cxx2
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));
}
}
}