reta commented on code in PR #3512:
URL: https://github.com/apache/cxf/pull/3512#discussion_r4122132525
##########
core/src/main/java/org/apache/cxf/ws/addressing/EndpointReferenceUtils.java:
##########
@@ -555,7 +574,9 @@ private static Schema createSchema(ServiceInfo serviceInfo,
Bus b) {
if (resolver.getInputStream() == null) {
sch.write(out);
} else {
-
IOUtils.copyAndCloseInput(resolver.getInputStream(), out);
+ // Re-parse securely rather than copying the
raw bytes, so that any
+ // DTD in the fetched document never reaches
the SchemaFactory
+
out.write(toSecureBytes(resolver.getInputStream(), sch.getSourceURI()));
Review Comment:
Shouldn't we close input here?
```suggestion
try (InputStream in = resolver.getInputStream() {
out.write(toSecureBytes(in), sch.getSourceURI()));
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]