mirror of
https://gitlab.gnome.org/GNOME/libxslt
synced 2025-08-08 21:42:07 +03:00
Exit after compilation of invalid func:result
Second part of bug #680920.
This commit is contained in:
committed by
Daniel Veillard
parent
14ee81b06c
commit
aebfee35d1
@@ -562,6 +562,7 @@ exsltFuncResultComp (xsltStylesheetPtr style, xmlNodePtr inst,
|
||||
xsltGenericError(xsltGenericErrorContext,
|
||||
"exsltFuncResultElem: only xsl:fallback is "
|
||||
"allowed to follow func:result\n");
|
||||
style->errors++;
|
||||
return (NULL);
|
||||
}
|
||||
/* it is an error for a func:result element to not be a descendant
|
||||
@@ -578,6 +579,7 @@ exsltFuncResultComp (xsltStylesheetPtr style, xmlNodePtr inst,
|
||||
xsltGenericError(xsltGenericErrorContext,
|
||||
"func:result element not a descendant "
|
||||
"of a func:function\n");
|
||||
style->errors++;
|
||||
return (NULL);
|
||||
}
|
||||
if ((test->ns != NULL) &&
|
||||
@@ -589,6 +591,7 @@ exsltFuncResultComp (xsltStylesheetPtr style, xmlNodePtr inst,
|
||||
xsltGenericError(xsltGenericErrorContext,
|
||||
"func:result element not allowed within"
|
||||
" another func:result element\n");
|
||||
style->errors++;
|
||||
return (NULL);
|
||||
}
|
||||
}
|
||||
@@ -598,6 +601,7 @@ exsltFuncResultComp (xsltStylesheetPtr style, xmlNodePtr inst,
|
||||
xsltGenericError(xsltGenericErrorContext,
|
||||
"func:result element not allowed within"
|
||||
" a variable binding element\n");
|
||||
style->errors++;
|
||||
return (NULL);
|
||||
}
|
||||
}
|
||||
@@ -611,6 +615,7 @@ exsltFuncResultComp (xsltStylesheetPtr style, xmlNodePtr inst,
|
||||
xsltPrintErrorContext(NULL, NULL, NULL);
|
||||
xsltGenericError(xsltGenericErrorContext,
|
||||
"exsltFuncResultComp : malloc failed\n");
|
||||
style->errors++;
|
||||
return (NULL);
|
||||
}
|
||||
memset(ret, 0, sizeof(exsltFuncResultPreComp));
|
||||
|
1
tests/docs/bug-174.xml
Normal file
1
tests/docs/bug-174.xml
Normal file
@@ -0,0 +1 @@
|
||||
<doc/>
|
1
tests/general/bug-174.err
Normal file
1
tests/general/bug-174.err
Normal file
@@ -0,0 +1 @@
|
||||
exsltFuncResultElem: only xsl:fallback is allowed to follow func:result
|
0
tests/general/bug-174.out
Normal file
0
tests/general/bug-174.out
Normal file
18
tests/general/bug-174.xsl
Normal file
18
tests/general/bug-174.xsl
Normal file
@@ -0,0 +1,18 @@
|
||||
<xsl:stylesheet
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:func = "http://exslt.org/functions"
|
||||
version="1.0" extension-element-prefixes="func">
|
||||
|
||||
<func:function name="func:uaf">
|
||||
<func:result/>
|
||||
<func:result/>
|
||||
</func:function>
|
||||
|
||||
<xsl:template match="/">
|
||||
<result>
|
||||
<xsl:value-of select="func:uaf()"/>
|
||||
</result>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
Reference in New Issue
Block a user