Re: BUG #15624: Sefgault when xml_errorHandler receives a null error->message from libxml2

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #15624: Sefgault when xml_errorHandler receives a null error->message from libxml2
Дата
Msg-id 32330.1549648428@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #15624: Sefgault when xml_errorHandler receives a null error->message from libxml2  (PG Bug reporting form <noreply@postgresql.org>)
Ответы Re: BUG #15624: Sefgault when xml_errorHandler receives a nullerror->message from libxml2  (Sergio Conde Gómez <skgsergio@gmail.com>)
Список pgsql-bugs
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


В списке pgsql-bugs по дате отправления:

Предыдущее
От: PG Bug reporting form
Дата:
Сообщение: BUG #15624: Sefgault when xml_errorHandler receives a null error->message from libxml2
Следующее
От: Sergio Conde Gómez
Дата:
Сообщение: Re: BUG #15624: Sefgault when xml_errorHandler receives a nullerror->message from libxml2