diff options
author | Sylvain Joubert <joubert.sy@gmail.com> | 2019-11-18 14:23:01 (GMT) |
---|---|---|
committer | Sylvain Joubert <joubert.sy@gmail.com> | 2019-11-19 19:06:31 (GMT) |
commit | b4ef7fbaa8257254abba0d7847941baf78fdb6ed (patch) | |
tree | 3f2c8851e7ac9955ac861b09c1e399dd3acb0563 /Help/guide/tutorial/Complete/MathFunctions/MathFunctions.cxx | |
parent | 3520208cbd0ebf9f3db1a9711b49286462cd7e54 (diff) | |
download | CMake-b4ef7fbaa8257254abba0d7847941baf78fdb6ed.zip CMake-b4ef7fbaa8257254abba0d7847941baf78fdb6ed.tar.gz CMake-b4ef7fbaa8257254abba0d7847941baf78fdb6ed.tar.bz2 |
ccmake: Fix crash with cache entries almost the size of the window
The previous code:
if (curFieldLen < width) {
...
strncpy(bar + curFieldLen + 2, help, width - curFieldLen - 2);
was not correctly guarded against cache entries whose size were exactly
1 or 2 characters short of the window size.
"if (curFieldLen - 2 < width)" would have prevented a copy of
negative/max_int characters and a subsequent crash.
The whole method was modernized with std::string instead of char*
Diffstat (limited to 'Help/guide/tutorial/Complete/MathFunctions/MathFunctions.cxx')
0 files changed, 0 insertions, 0 deletions