mirror of
https://github.com/Z3Prover/z3
synced 2025-04-29 03:45:51 +00:00
fix a couple hundred deref-after-free bugs due to .c_str() on a temporary string
This commit is contained in:
parent
48a9defb0d
commit
23e6adcad3
64 changed files with 248 additions and 229 deletions
|
@ -24,6 +24,7 @@ Revision History:
|
|||
#include<climits>
|
||||
#include<limits>
|
||||
#include<stdint.h>
|
||||
#include <string>
|
||||
|
||||
#ifndef SIZE_MAX
|
||||
#define SIZE_MAX std::numeric_limits<std::size_t>::max()
|
||||
|
@ -375,6 +376,7 @@ class escaped {
|
|||
char const * end() const;
|
||||
public:
|
||||
escaped(char const * str, bool trim_nl = false, unsigned indent = 0):m_str(str), m_trim_nl(trim_nl), m_indent(indent) {}
|
||||
escaped(const std::string &str, bool trim_nl = false, unsigned indent = 0):m_str(str.c_str()), m_trim_nl(trim_nl), m_indent(indent) {}
|
||||
void display(std::ostream & out) const;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue