makdimka077 / xades4j

Automatically exported from code.google.com/p/xades4j
GNU Lesser General Public License v3.0
0 stars 0 forks source link

SignaturePolicyVerifier leaks stream upon exception #24

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. In SignaturePolicyVerifier.verify(), the code calls StreamUtils.readWrite() 
followed by a close within the same try-catch. This will skip the call to 
sigDocStream.close() if the readWrite() throws an exception. A better idiom is 
to call sigDocStream.close() in a finally clause. There are examples of this in 
xades4j.utils.Base64

What is the expected output? What do you see instead?
The stream obtained from 
policyDocumentProvider.getSignaturePolicyDocumentStream(policyId) should be 
closed even if reading the stream causes an IO exception.

What version of the product are you using? On what operating system?
1.2.0
Windows 7

Please provide any additional information below.

Original issue reported on code.google.com by clementp...@gmail.com on 14 Nov 2011 at 4:41

GoogleCodeExporter commented 9 years ago

Original comment by luis.fgoncalv on 14 Nov 2011 at 10:49

GoogleCodeExporter commented 9 years ago
http://code.google.com/p/xades4j/source/detail?r=148

Original comment by luis.fgoncalv on 15 Nov 2011 at 12:01