summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Paquier2025-07-06 23:54:41 +0000
committerMichael Paquier2025-07-06 23:54:41 +0000
commit75c1eb60b2ccae893cf05eaab04668bdb4655864 (patch)
tree59ef67f5c74e416ac444f8c842710fc8738393d2
parentbd48455d88a8e69a85f040018e9dd8c7d129ea0e (diff)
Fix incompatibility with libxml2 >= 2.14REL_15_STABLE
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 400928b83bd2, 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 <[email protected]> Reviewed-by: Tom Lane <[email protected]> Discussion: https://postgr.es/m/[email protected] Backpatch-through: 13
-rw-r--r--contrib/xml2/xpath.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/xml2/xpath.c b/contrib/xml2/xpath.c
index 212cb74aa22..94bb31434c8 100644
--- a/contrib/xml2/xpath.c
+++ b/contrib/xml2/xpath.c
@@ -174,7 +174,7 @@ pgxmlNodeSetToText(xmlNodeSetPtr nodeset,
xmlBufferWriteCHAR(buf, toptagname);
xmlBufferWriteChar(buf, ">");
}
- result = xmlStrdup(buf->content);
+ result = xmlStrdup(xmlBufferContent(buf));
xmlBufferFree(buf);
return result;
}