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

Potential security issue in lib/sha256.c: Unchecked return from initialization function #5414

Closed
wants to merge 1 commit into from

Conversation

@monocle-ai
Copy link

@monocle-ai monocle-ai commented May 18, 2020

What is a Conditionally Uninitialized Variable? The return value of a function that is potentially used to initialize a local variable is not checked. Therefore, reading the local variable may result in undefined behavior.

1 instance of this defect were found in the following locations:

Instance 1
File : lib/sha256.c
Function: CryptGetHashParam

CryptGetHashParam(ctx->hHash, HP_HASHVAL, NULL, &length, 0);

Code extract:

{
  unsigned long length;

  CryptGetHashParam(ctx->hHash, HP_HASHVAL, NULL, &length, 0); <------ HERE
  if(length == SHA256_DIGEST_LENGTH)
    CryptGetHashParam(ctx->hHash, HP_HASHVAL, digest, &length, 0);
lib/sha256.c Show resolved Hide resolved
@bagder bagder closed this in fae3065 May 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.