Skip to content

When using file signature to ID file types, ran into a collision which mis-identified a file type.  #18

@Quade3699

Description

@Quade3699

I had a multifile RAR set that refused to decode. It failed while opening the first archive. I troubleshot it down to where it picked which codec to use. It found a "BD" in the data for a two character signature and then picked the wrong codec which failed to open the archive.

I changed the code to require that both the signature and extension match. It works but it defeats the purpose of using signature only. My suggestion is sort the signatures in "length of signature" order so the long signatures get checked before the short signatures. Every byte of additional signature that matches increases the confidence in the signature match.

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