Skip to content

Potential bug in hash function #34

@georgeBacon23

Description

@georgeBacon23

In the file TargetHashingClient.java, the function createHashForRule creates a hash for a rule by considering the rule's inputs and if necessary recursively hashing inputs that are rules. A hashmap ruleHashes is used to cache previously computed rule hashes. I think there is a bug here, as at least on my system, the MessageDigest object is reset when .digest() is called. So if the rule is in the cache, the first time it is found it will be reset when digest is called to update the parent's digest. Any other rules that use it will subsequently update with the wrong hash.

Am I missing something here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions