Skip to content

Commit

Permalink
pkey_gost_ctrl: check for NULL after allocating pctx->shared_ukm
Browse files Browse the repository at this point in the history
Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Richard Levitte <levitte@openssl.org>
  • Loading branch information
Jonas Maebe authored and kroeckx committed Dec 4, 2014
1 parent 12478cc commit 787e992
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions engines/ccgost/gost_pmeth.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ static int pkey_gost_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)
return 1;
case EVP_PKEY_CTRL_SET_IV:
pctx->shared_ukm=OPENSSL_malloc((int)p1);
if (pctx->shared_ukm == NULL)
{
GOSTerr(GOST_F_PKEY_GOST_CTRL, ERR_R_MALLOC_FAILURE);
return 0;
}
memcpy(pctx->shared_ukm,p2,(int) p1);
return 1;
case EVP_PKEY_CTRL_PEER_KEY:
Expand Down

0 comments on commit 787e992

Please sign in to comment.