pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: skgsergio@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15624: Sefgault when xml_errorHandler receives a null error->message from libxml2
Date: Fri, 08 Feb 2019 12:53:48 -0500
Message-ID: <32330.1549648428@sss.pgh.pa.us> (raw)
In-Reply-To: <15624-4dea54091a2864e6@postgresql.org>
References: <15624-4dea54091a2864e6@postgresql.org>

PG Bug reporting form <noreply@postgresql.org> writes:
> Although libxml2 tries not to return a null message but both their xmlStrdup
> function and XML_GET_VAR_STR can return null in a OOM scenario.

Ugh.

> -	appendStringInfoString(errorBuf, error->message);
> +	if (error->message != NULL)
> +		appendStringInfoString(errorBuf, error->message);

I'm inclined to do something more like

+	if (error->message != NULL)
+		appendStringInfoString(errorBuf, error->message);
+	else
+		appendStringInfoString(errorBuf, "(no message provided)");

else the output will read very oddly in this situation.

Thanks for the report!

			regards, tom lane




view thread (4+ messages)  latest in thread

Message-ID: <32330.1549648428@sss.pgh.pa.us>
Permalink:  ../32330.1549648428@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/32330.1549648428@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, skgsergio@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #15624: Sefgault when xml_errorHandler receives a null error->message from libxml2
  In-Reply-To: <32330.1549648428@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox