3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-26 04:56:03 +00:00

Fix nullptr dereference in pp_symbol with null symbol names

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2025-08-16 02:41:48 +00:00
parent b653b6d34e
commit ed874351be

View file

@ -42,9 +42,14 @@ static unsigned pp_symbol(std::ostream & out, symbol const & s) {
return static_cast<unsigned>(str.length()); return static_cast<unsigned>(str.length());
} }
else { else {
if (s.is_null()) {
out << "null";
return 4; // length of "null"
} else {
out << s.bare_str(); out << s.bare_str();
return static_cast<unsigned>(strlen(s.bare_str())); return static_cast<unsigned>(strlen(s.bare_str()));
} }
}
} }
#define TAB_SZ 2 #define TAB_SZ 2