X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fts%2Fts_rsp_verify.c;h=e1f3b534afbc9523c09b4f93a999fb01c2e5e785;hp=6acacac6c14f0d2b42657bc2560a902d52a6714a;hb=0eab41fb78cf4d7c76e563fd677ab6c32fc28bb0;hpb=8aa02e97a782a4229936d5df6da42db3efe4acd1 diff --git a/crypto/ts/ts_rsp_verify.c b/crypto/ts/ts_rsp_verify.c index 6acacac6c1..e1f3b534af 100644 --- a/crypto/ts/ts_rsp_verify.c +++ b/crypto/ts/ts_rsp_verify.c @@ -604,7 +604,10 @@ static int TS_compute_imprint(BIO *data, TS_TST_INFO *tst_info, } /* Compute message digest. */ - *imprint_len = EVP_MD_size(md); + length = EVP_MD_size(md); + if (length < 0) + goto err; + *imprint_len = length; if (!(*imprint = OPENSSL_malloc(*imprint_len))) { TSerr(TS_F_TS_COMPUTE_IMPRINT, ERR_R_MALLOC_FAILURE);