From: tb Date: Wed, 31 Aug 2022 09:39:59 +0000 (+0000) Subject: Some missing return checks X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=d179e8082fbc7d38c661d7617392fc616034d0f1;p=openbsd Some missing return checks --- diff --git a/regress/lib/libcrypto/ecdsa/ecdsatest.c b/regress/lib/libcrypto/ecdsa/ecdsatest.c index 6cbe345d08e..cb8f38b3480 100644 --- a/regress/lib/libcrypto/ecdsa/ecdsatest.c +++ b/regress/lib/libcrypto/ecdsa/ecdsatest.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ecdsatest.c,v 1.12 2022/08/31 09:38:00 tb Exp $ */ +/* $OpenBSD: ecdsatest.c,v 1.13 2022/08/31 09:39:59 tb Exp $ */ /* * Written by Nils Larsch for the OpenSSL project. */ @@ -340,7 +340,8 @@ test_builtin(BIO *out) goto builtin_err; sig_ptr2 = signature; - sig_len = i2d_ECDSA_SIG(ecdsa_sig, &sig_ptr2); + if ((sig_len = i2d_ECDSA_SIG(ecdsa_sig, &sig_ptr2)) <= 0) + goto builtin_err; if (ECDSA_verify(0, digest, 20, signature, sig_len, eckey) == 1) { BIO_printf(out, " failed\n"); @@ -363,7 +364,8 @@ test_builtin(BIO *out) goto builtin_err; sig_ptr2 = signature; - sig_len = i2d_ECDSA_SIG(ecdsa_sig, &sig_ptr2); + if ((sig_len = i2d_ECDSA_SIG(ecdsa_sig, &sig_ptr2)) <= 0) + goto builtin_err; if (ECDSA_verify(0, digest, 20, signature, sig_len, eckey) != 1) { BIO_printf(out, " failed\n");