Skip to content
Snippets Groups Projects
Commit 6ffc4323 authored by Brad King's avatar Brad King
Browse files

cmConditionEvaluator: Fix matching of `CMAKE_MATCH_*` values (#15944)

While evaluating `if(MATCHES)` we get a `const char*` pointer to the
string to be matched.  On code like

    if(CMAKE_MATCH_COUNT MATCHES "Y")

the string to be matched may be owned by our own result variables.
We must move the value to our own buffer before clearing them.
Otherwise we risk reading freed storage.
parent 656768cf
Branches
Tags
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment