3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-05 23:05:46 +00:00

fix a couple hundred deref-after-free bugs due to .c_str() on a temporary string

This commit is contained in:
Nuno Lopes 2020-07-11 20:24:45 +01:00
parent 48a9defb0d
commit 23e6adcad3
64 changed files with 248 additions and 229 deletions

View file

@ -677,9 +677,11 @@ extern "C" {
to_fixedpoint_ref(d)->ctx().get_rules_along_trace_as_formulas(rules, names);
for (unsigned i = 0; i < names.size(); ++i) {
ss << ";" << names[i].str();
if (i != 0)
ss << ';';
ss << names[i].str();
}
return of_symbol(symbol(ss.str().substr(1).c_str()));
return of_symbol(symbol(ss.str()));
Z3_CATCH_RETURN(of_symbol(symbol::null));
}