8000 Fix incompatibility with libxml2 >= 2.14 · postgres/postgres@8d1071e · GitHub
[go: up one dir, main page]

Skip to content < 8000 link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/keyboard-shortcuts-dialog.47de85e2c17af43cefd5.module.css" />

Commit 8d1071e

Browse files
committed
Fix incompatibility with libxml2 >= 2.14
libxml2 has deprecated the members of xmlBuffer, and it is recommended to access them with dedicated routines. We have only one case in the tree where this shows an impact: xml2/xpath.c where "content" was getting directly accessed. The rest of the code looked fine, checking the PostgreSQL code with libxml2 close to the top of its "2.14" branch. xmlBufferContent() exists since year 2000 based on a check of the upstream libxml2 tree, so let's switch to it. Like 400928b, backpatch all the way down as this can have an impact on all the branches already released once newer versions of libxml2 get more popular. Reported-by: Walid Ibrahim <walidib@amazon.com> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/aGdSdcR4QTjEHX6s@paquier.xyz Backpatch-through: 13
1 parent 1e00772 commit 8d1071e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

contrib/xml2/xpath.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ pgxmlNodeSetToText(xmlNodeSetPtr nodeset,
176176
xmlBufferWriteCHAR(buf, toptagname);
177177
xmlBufferWriteChar(buf, ">");
178178
}
179-
result = xmlStrdup(buf->content);
179+
result = xmlStrdup(xmlBufferContent(buf));
180180
xmlBufferFree(buf);
181181
return result;
182182
}

0 commit comments

Comments
 (0)
0