tested a patch to contrib/xml where the existing code was causing
postgres to crash when it encountered & entities in the XML. I've
enclosed a patch that John came up with to correct this problem. It
patches against 7.3 and will apply on 7.2x if the elog WARNING calls
are changed to elog NOTICE.
Michael Richards
doctree = xmlParseMemory((char *) VARDATA(t), docsize);
if (doctree == NULL)
{
- /* xmlCleanupParser(); */
+ xmlCleanupParser();
PG_RETURN_BOOL(false); /* i.e. not well-formed */
}
- /* xmlCleanupParser(); */
+ xmlCleanupParser();
xmlFreeDoc(doctree);
PG_RETURN_BOOL(true);
}
doctree = xmlParseMemory((char *) VARDATA(t), docsize);
if (doctree == NULL)
- { /* not well-formed */
+ { /* not well-formed */
+ xmlCleanupParser();
PG_RETURN_NULL();
}
elog(WARNING, "XPath syntax error");
xmlFreeDoc(doctree);
pfree((void *) xpath);
+ xmlCleanupParser();
PG_RETURN_NULL();
}
{
xmlFreeDoc(doctree);
pfree((void *) xpath);
+ xmlCleanupParser();
PG_RETURN_NULL(); /* seems appropriate */
}
/* now we dump this node, ?surrounding by tags? */
xmlFreeDoc(doctree);
pfree((void *) xpath);
xmlFree(xpresstr);
-
+ xmlCleanupParser();
PG_RETURN_TEXT_P(xpres);
}