Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

locationFixups map is not collision proof resulting with a corrupted ISO file #42

Open
nithril opened this issue Mar 27, 2024 · 1 comment

Comments

@nithril
Copy link

nithril commented Mar 27, 2024

Hello,

Issue created for the record as the project is not maintained anymore for future user hitting the issue.

In the method com.github.stephenc.javaisotools.iso9660.impl.ISO9660Factory#doFileFixup

The following code is using as a key the hashcode of an object (file.getContentID() returns the hashcode of file) that can be per contract not unique:

        if (locationFixups.containsKey(file.getContentID())) {
            location = ((Integer) locationFixups.get(file.getContentID())).intValue();
        } else {
            locationFixups.put(file.getContentID(), new Integer(location));
        }

There can be collision resulting in the reuse of a location for a file that is not actually the same.

@jaksat0202
Copy link

Yes, it is a nasty bug that hits you when the number of files is large and there are no tests for this scenario.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants