Skip to content

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

@nithril

Description

@nithril

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions