Skip to content

Commit

Permalink
lib/hcrypto/evp.c: missing MD guards
Browse files Browse the repository at this point in the history
  • Loading branch information
nicowilliams committed Apr 15, 2016
1 parent 5c2a3cb commit 8033eb2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/hcrypto/evp.c
Expand Up @@ -260,11 +260,15 @@ EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *md, ENGINE *engine)
EVP_MD_CTX_cleanup(ctx);
ctx->md = md;
ctx->engine = engine;
if (md == NULL)
return 0;

ctx->ptr = calloc(1, md->ctx_size);
if (ctx->ptr == NULL)
return 0;
}
if (ctx->md == 0)
return 0;
return (ctx->md->init)(ctx->ptr);
}

Expand Down

0 comments on commit 8033eb2

Please sign in to comment.