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

Commit8e29567

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 parent8cf3fad commit8e29567

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
@@ -1696,7 +1696,10 @@ xml_errorHandler(void *data, xmlErrorPtr error)
16961696
appendStringInfo(errorBuf,"line %d: ",error->line);
16971697
if (name!=NULL)
16981698
appendStringInfo(errorBuf,"element %s: ",name);
1699-
appendStringInfoString(errorBuf,error->message);
1699+
if (error->message!=NULL)
1700+
appendStringInfoString(errorBuf,error->message);
1701+
else
1702+
appendStringInfoString(errorBuf,"(no message provided)");
17001703

17011704
/*
17021705
* Append context information to errorBuf.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp