mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 15:54:57 +01:00
When printing an XML related error, guard against NULL pointers getting passed to our error stream
This commit is contained in:
parent
cf5a8651d8
commit
a7508a9cf0
1 changed files with 10 additions and 4 deletions
|
|
@ -203,13 +203,19 @@ static void
|
|||
libxml_structured_error_func (void* /* parsing_context*/,
|
||||
xmlErrorPtr err)
|
||||
{
|
||||
string msg = err->message;
|
||||
string msg;
|
||||
|
||||
if (err->message)
|
||||
msg = err->message;
|
||||
|
||||
replace_all (msg, "\n", "");
|
||||
|
||||
error << X_("XML error: ") << msg << " in " << err->file << " at line " << err->line;
|
||||
if (err->int2) {
|
||||
error << ':' << err->int2;
|
||||
if (err->file && err->line) {
|
||||
error << X_("XML error: ") << msg << " in " << err->file << " at line " << err->line;
|
||||
|
||||
if (err->int2) {
|
||||
error << ':' << err->int2;
|
||||
}
|
||||
}
|
||||
error << endmsg;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue