Skip to content
Snippets Groups Projects
Commit b4ef7fba authored by Sylvain Joubert's avatar Sylvain Joubert
Browse files

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*
parent 3520208c
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment