Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.0
-
None
Description
CompressedFileFileObject blindly performs a substring operation on an unchecked String index lookup value. If that value happens to be -1 (lookup not found), then an Index Out Of Bounds error is thrown. The lookup is for a "." to find the base file name.
This happens when trying to decompress a file with no file extension.
subversion revision: 1159220 for CompressedFileFileObject.java
code in repository: line 42:
// todo, add getBaseName(String) to FileName
String basename = container.getName().getBaseName();
int pos = basename.lastIndexOf('.');
basename = basename.substring(0, pos);
should alter that last line to something like:
if (pos > 0)
basename = basename.substring(0, pos);