RFR: 8255559: Leak File Descriptors Because of ResolverLocalFilesystem#engineResolveURI()

Prajwal Kumaraswamy github.com+70745465+pkumaraswamy at openjdk.java.net
Tue Nov 10 16:10:10 UTC 2020


…ineResolveURI().

Actual fix looks like this, due to git diff there are lot  of changes( mostly because of the spaces) being displayed.

--- a/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMReference.java
+++ b/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMReference.java
@@ -500,6 +500,7 @@
                 }
 
                 boolean secVal = Utils.secureValidation(context);
+                try {
                 xi.setSecureValidation(secVal);
                 if (context instanceof XMLSignContext && c14n11
                     && !xi.isOctetStream() && !xi.isOutputStreamSet()) {
@@ -533,6 +534,11 @@
                 } else {
                     xi.updateOutputStream(os);
                 }
+                } finally {
+                    if(xi.getOctetStreamReal() != null) {
+                        xi.getOctetStreamReal().close();
+                    }
+                }
             }

-------------

Commit messages:
 - 8255559: Leak File Descriptors Because of ResolverLocalFilesystem#engineResolveURI().

Changes: https://git.openjdk.java.net/jdk/pull/1142/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=1142&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8255559
  Stats: 44 lines in 1 file changed: 17 ins; 11 del; 16 mod
  Patch: https://git.openjdk.java.net/jdk/pull/1142.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/1142/head:pull/1142

PR: https://git.openjdk.java.net/jdk/pull/1142



More information about the security-dev mailing list