Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0edef16

Browse files
committed
Defend against null error message reported by libxml2.
While this isn't really supposed to happen, it can occur in OOMsituations and perhaps others. Instead of crashing, substitute"(no message provided)".I didn't worry about localizing this text, since we aren'tlocalizing anything else here; besides, if we're on the edge ofOOM, it's unlikely gettext() would work.Report and fix by Sergio Conde Gómez in bug #15624.Discussion:https://postgr.es/m/15624-4dea54091a2864e6@postgresql.org
1 parentf10a20e commit0edef16

File tree

1 file changed

+4
-1
lines changed
  • src/backend/utils/adt

1 file changed

+4
-1
lines changed

‎src/backend/utils/adt/xml.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1697,7 +1697,10 @@ xml_errorHandler(void *data, xmlErrorPtr error)
16971697
appendStringInfo(errorBuf,"line %d: ",error->line);
16981698
if (name!=NULL)
16991699
appendStringInfo(errorBuf,"element %s: ",name);
1700-
appendStringInfoString(errorBuf,error->message);
1700+
if (error->message!=NULL)
1701+
appendStringInfoString(errorBuf,error->message);
1702+
else
1703+
appendStringInfoString(errorBuf,"(no message provided)");
17011704

17021705
/*
17031706
* Append context information to errorBuf.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp