mirror of
https://gitlab.gnome.org/GNOME/libxslt
synced 2025-10-27 16:15:34 +03:00
End function node ancestor search at document
Avoids dereferencing a non-existent ->ns property on an XML_DOCUMENT_NODE pointer. Fixes #151.
This commit is contained in:
@@ -617,8 +617,13 @@ exsltFuncResultComp (xsltStylesheetPtr style, xmlNodePtr inst,
|
||||
* instanciation of a func:result element.
|
||||
*/
|
||||
for (test = inst->parent; test != NULL; test = test->parent) {
|
||||
if (IS_XSLT_ELEM(test) &&
|
||||
IS_XSLT_NAME(test, "stylesheet")) {
|
||||
if (/* Traversal has reached the top-level document without
|
||||
* finding a func:function ancestor. */
|
||||
(test != NULL && test->type == XML_DOCUMENT_NODE) ||
|
||||
/* Traversal reached a stylesheet-namespace node,
|
||||
* and has left the function namespace. */
|
||||
(IS_XSLT_ELEM(test) &&
|
||||
IS_XSLT_NAME(test, "stylesheet"))) {
|
||||
xsltGenericError(xsltGenericErrorContext,
|
||||
"func:result element not a descendant "
|
||||
"of a func:function\n");
|
||||
|
||||
Reference in New Issue
Block a user