Skip to content

[Bug]hash mismatch logic #640

Closed
Closed

Description

@jchrys

While reviewing the code in verify.c, I noticed a logic error involving the use of strcmp when comparing hash values. The current implementation uses:

if (!strcmp(hash, calculated_hash))
{
  // hash mismatch
}

This condition is incorrect if the intention is to detect mismatched hashes, since strcmp(a, b) returns 0 when strings are equal.

Activity

  1. added
    bug
    on May 25, 2025
  2. added 2 commits that reference this issue on May 25, 2025
  3. changed the title [-][Bug]Incorrect strcmp Logic in verify.c Hash Comparison[/-] [+][Bug]Incorrect hash mismatch[/+] on May 25, 2025
  4. changed the title [-][Bug]Incorrect hash mismatch[/-] [+][Bug]hash mismatch logic[/+] on May 25, 2025
  5. jesperpedersen commented on May 25, 2025

    @jesperpedersen
    Member

    @jchrys Can you send a patch for it ?

  6. added a commit that references this issue on May 26, 2025
  7. added a commit that references this issue on May 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions