Skip to content

Commit 35e0cae

Browse files
committedJul 10, 2019
8227402: Improve XSLT processing
Reviewed-by: kcr, rhalade
1 parent 141cf7e commit 35e0cae

File tree

4 files changed

+25
-20
lines changed

4 files changed

+25
-20
lines changed
 

‎modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libxslt/documents.c

+10-8
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,11 @@ xsltLoadDocument(xsltTransformContextPtr ctxt, const xmlChar *URI) {
296296
int res;
297297

298298
res = xsltCheckRead(ctxt->sec, ctxt, URI);
299-
if (res == 0) {
300-
xsltTransformError(ctxt, NULL, NULL,
301-
"xsltLoadDocument: read rights for %s denied\n",
302-
URI);
299+
if (res <= 0) {
300+
if (res == 0)
301+
xsltTransformError(ctxt, NULL, NULL,
302+
"xsltLoadDocument: read rights for %s denied\n",
303+
URI);
303304
return(NULL);
304305
}
305306
}
@@ -372,10 +373,11 @@ xsltLoadStyleDocument(xsltStylesheetPtr style, const xmlChar *URI) {
372373
int res;
373374

374375
res = xsltCheckRead(sec, NULL, URI);
375-
if (res == 0) {
376-
xsltTransformError(NULL, NULL, NULL,
377-
"xsltLoadStyleDocument: read rights for %s denied\n",
378-
URI);
376+
if (res <= 0) {
377+
if (res == 0)
378+
xsltTransformError(NULL, NULL, NULL,
379+
"xsltLoadStyleDocument: read rights for %s denied\n",
380+
URI);
379381
return(NULL);
380382
}
381383
}

‎modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libxslt/imports.c

+5-4
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,11 @@ xsltParseStylesheetImport(xsltStylesheetPtr style, xmlNodePtr cur) {
130130
int secres;
131131

132132
secres = xsltCheckRead(sec, NULL, URI);
133-
if (secres == 0) {
134-
xsltTransformError(NULL, NULL, NULL,
135-
"xsl:import: read rights for %s denied\n",
136-
URI);
133+
if (secres <= 0) {
134+
if (secres == 0)
135+
xsltTransformError(NULL, NULL, NULL,
136+
"xsl:import: read rights for %s denied\n",
137+
URI);
137138
goto error;
138139
}
139140
}

‎modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libxslt/transform.c

+5-4
Original file line numberDiff line numberDiff line change
@@ -3493,10 +3493,11 @@ xsltDocumentElem(xsltTransformContextPtr ctxt, xmlNodePtr node,
34933493
*/
34943494
if (ctxt->sec != NULL) {
34953495
ret = xsltCheckWrite(ctxt->sec, ctxt, filename);
3496-
if (ret == 0) {
3497-
xsltTransformError(ctxt, NULL, inst,
3498-
"xsltDocumentElem: write rights for %s denied\n",
3499-
filename);
3496+
if (ret <= 0) {
3497+
if (ret == 0)
3498+
xsltTransformError(ctxt, NULL, inst,
3499+
"xsltDocumentElem: write rights for %s denied\n",
3500+
filename);
35003501
xmlFree(URL);
35013502
xmlFree(filename);
35023503
return;

‎modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libxslt/xslt.c

+5-4
Original file line numberDiff line numberDiff line change
@@ -6763,10 +6763,11 @@ xsltParseStylesheetFile(const xmlChar* filename) {
67636763
int res;
67646764

67656765
res = xsltCheckRead(sec, NULL, filename);
6766-
if (res == 0) {
6767-
xsltTransformError(NULL, NULL, NULL,
6768-
"xsltParseStylesheetFile: read rights for %s denied\n",
6769-
filename);
6766+
if (res <= 0) {
6767+
if (res == 0)
6768+
xsltTransformError(NULL, NULL, NULL,
6769+
"xsltParseStylesheetFile: read rights for %s denied\n",
6770+
filename);
67706771
return(NULL);
67716772
}
67726773
}

0 commit comments

Comments
 (0)
Please sign in to comment.