summaryrefslogtreecommitdiffstats
path: root/crypto/ts/ts_rsp_verify.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/ts/ts_rsp_verify.c')
-rw-r--r--crypto/ts/ts_rsp_verify.c5
1 files changed, 4 insertions, 1 deletions
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);