3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-11 09:44:43 +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

@ -42,7 +42,7 @@ void tst_expr_arith(unsigned num_files) {
std::ostringstream buffer;
buffer << "random_arith_" << i << ".smt2";
std::cout << buffer.str() << "\n";
std::ofstream file(buffer.str().c_str());
std::ofstream file(buffer.str());
pp.display_smt2(file, e.get());
file.close();
}
@ -85,7 +85,7 @@ void tst_expr_rand(unsigned num_files) {
std::ostringstream buffer;
buffer << "random_bv_" << i << ".smt2";
std::cout << buffer.str() << "\n";
std::ofstream file(buffer.str().c_str());
std::ofstream file(buffer.str());
pp.display_smt2(file, e.get());
file.close();