mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-02 04:09:33 -05:00
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.
This commit is contained in:
@@ -475,7 +475,7 @@ void cmCursesMainForm::UpdateStatusBar(const char* message)
|
|||||||
strncpy(bar + curFieldLen + 2, help, width - curFieldLen - 2);
|
strncpy(bar + curFieldLen + 2, help, width - curFieldLen - 2);
|
||||||
if (curFieldLen + helpLen + 2 < width) {
|
if (curFieldLen + helpLen + 2 < width) {
|
||||||
memset(bar + curFieldLen + helpLen + 2, ' ',
|
memset(bar + curFieldLen + helpLen + 2, ' ',
|
||||||
width - curFieldLen + helpLen + 2);
|
width - (curFieldLen + helpLen + 2));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user