david-lshift / winzipaes

Automatically exported from code.google.com/p/winzipaes
0 stars 0 forks source link

extractEntryWithTmpFile throws NullPointerException when passing it a filename without any path #43

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Pass new File("somefile.txt") to extractEntryWithTmpFile, run the program:

Exception in thread "main" java.lang.NullPointerException
        at java.io.File.<init>(File.java:239)
        at de.idyl.winzipaes.AesZipFileDecrypter.extractEntryWithTmpFile(AesZipFileDecrypter.java:206)

The code examination suggests that getParent() can return null if the filename 
of outFile doesn't have any directory. new File(null) then throws the exception.

// create tmp file that contains the decrypted, but still compressed data
File tmpFile = new File( outFile.getPath() + "_TMP.zip" );
makeDir( new File(tmpFile.getParent()) );

Original issue reported on code.google.com by avay...@gmail.com on 3 Apr 2012 at 5:34

GoogleCodeExporter commented 9 years ago
fixed - thank you for the issue report

Original comment by olaf.merkert on 16 Apr 2012 at 8:45