Fixes the issue where pdnsutil would segfault when query logging is enabled, and would
leave the db unmodified. Surprisingly, the segfault only happened on FreeBSD.
Fixes #11731
(cherry picked from commit
fd4fd2dae2f29f668b7ad0645c112b12854ab834)
if (i != 0) {
log_message << ", ";
}
- log_message << "$" << (i + 1) << " = '" << paramValues[i] << "'";
+ log_message << "$" << (i + 1) << " = ";
+ if (paramValues[i] == nullptr) {
+ log_message << "NULL";
+ }
+ else {
+ log_message << "'" << paramValues[i] << "'";
+ }
}
g_log << Logger::Warning << log_message.str() << endl;
}