What steps will reproduce the problem?
1. Try to open a file, which is not a zip file, using AesZipFileDecrypter, by
passing java.io.File to it.
2. It will throw an exception, which is as expected.
3. But the file resource is not closed by decrypter.
What is the expected output? What do you see instead?
The exception should be thrown, but the file must be closed.
What version of the product are you using? On what operating system?
We found the source of bug by looking into code in trunk of winzipaes.
Please provide any additional information below.
The following monkey-patch resolves the problem:
replace
dec = new AesZipFileDecrypter(packedFile, decBc);
with
dec = new AesZipFileDecrypter(packedFile, decBc){
protected void initDirOffsetPosAndComment() throws IOException {
try {
super.initDirOffsetPosAndComment();
} catch(IOException e) {
try{
close();
} catch(IOException ex){
}
throw e;
}
}
} ;
Original issue reported on code.google.com by ilya.por...@gmail.com on 16 Feb 2015 at 6:05
Original issue reported on code.google.com by
ilya.por...@gmail.com
on 16 Feb 2015 at 6:05