summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2022-08-31 09:40:00 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2022-08-31 09:40:00 +0000
commit931107998115da01154fd7662b1aa2d5cba597bd (patch)
tree4be054b4f65005559f6a07289ed4e838a9e2bebd /regress
parentf71e32b796694146439ddff0dc3988f9c7bb480a (diff)
Some missing return checks
Diffstat (limited to 'regress')
-rw-r--r--regress/lib/libcrypto/ecdsa/ecdsatest.c8
1 files changed, 5 insertions, 3 deletions
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");