Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(238)

Unified Diff: third_party/libxslt/libxslt/attributes.c

Issue 1848793005: Roll libxslt to 891681e3e948f31732229f53cb6db7215f740fc7 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/libxslt/libxslt/Makefile.in ('k') | third_party/libxslt/libxslt/extensions.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/libxslt/libxslt/attributes.c
diff --git a/third_party/libxslt/libxslt/attributes.c b/third_party/libxslt/libxslt/attributes.c
index 2fa86e3c9632a396c2bc04171dc341c96921da59..8440b1031592ab61ddbf2bda003a4e2428ae41fb 100644
--- a/third_party/libxslt/libxslt/attributes.c
+++ b/third_party/libxslt/libxslt/attributes.c
@@ -297,9 +297,11 @@ xsltParseStylesheetAttributeSet(xsltStylesheetPtr style, xmlNodePtr cur) {
return;
value = xmlGetNsProp(cur, (const xmlChar *)"name", NULL);
- if (value == NULL) {
+ if ((value == NULL) || (*value == 0)) {
xsltGenericError(xsltGenericErrorContext,
"xsl:attribute-set : name is missing\n");
+ if (value)
+ xmlFree(value);
return;
}
@@ -482,19 +484,27 @@ xsltGetSAS(xsltStylesheetPtr style, const xmlChar *name, const xmlChar *ns) {
}
/**
- * xsltResolveSASCallback,:
+ * xsltResolveSASCallbackInt:
* @style: the XSLT stylesheet
*
* resolve the references in an attribute set.
*/
static void
-xsltResolveSASCallback(xsltAttrElemPtr values, xsltStylesheetPtr style,
+xsltResolveSASCallbackInt(xsltAttrElemPtr values, xsltStylesheetPtr style,
const xmlChar *name, const xmlChar *ns,
- ATTRIBUTE_UNUSED const xmlChar *ignored) {
+ int depth) {
xsltAttrElemPtr tmp;
xsltAttrElemPtr refs;
tmp = values;
+ if ((name == NULL) || (name[0] == 0))
+ return;
+ if (depth > 100) {
+ xsltGenericError(xsltGenericErrorContext,
+ "xsl:attribute-set : use-attribute-sets recursion detected on %s\n",
+ name);
+ return;
+ }
while (tmp != NULL) {
if (tmp->set != NULL) {
/*
@@ -519,7 +529,7 @@ xsltResolveSASCallback(xsltAttrElemPtr values, xsltStylesheetPtr style,
/*
* recurse first for cleanup
*/
- xsltResolveSASCallback(refs, style, name, ns, NULL);
+ xsltResolveSASCallbackInt(refs, style, name, ns, depth + 1);
/*
* Then merge
*/
@@ -537,6 +547,19 @@ xsltResolveSASCallback(xsltAttrElemPtr values, xsltStylesheetPtr style,
}
/**
+ * xsltResolveSASCallback,:
+ * @style: the XSLT stylesheet
+ *
+ * resolve the references in an attribute set.
+ */
+static void
+xsltResolveSASCallback(xsltAttrElemPtr values, xsltStylesheetPtr style,
+ const xmlChar *name, const xmlChar *ns,
+ ATTRIBUTE_UNUSED const xmlChar *ignored) {
+ xsltResolveSASCallbackInt(values, style, name, ns, 1);
+}
+
+/**
* xsltMergeSASCallback,:
* @style: the XSLT stylesheet
*
« no previous file with comments | « third_party/libxslt/libxslt/Makefile.in ('k') | third_party/libxslt/libxslt/extensions.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698