From ad41f5e17e8b68df90b035edf58566f629e3b2de Mon Sep 17 00:00:00 2001 From: tb Date: Sat, 4 Mar 2023 21:08:14 +0000 Subject: [PATCH] Small readability tweak in old_dsa_priv_decode() Explicitly check against NULL and turn early return into goto err. ok beck jsing --- lib/libcrypto/dsa/dsa_ameth.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libcrypto/dsa/dsa_ameth.c b/lib/libcrypto/dsa/dsa_ameth.c index b7a05e72fae..495c32cbae6 100644 --- a/lib/libcrypto/dsa/dsa_ameth.c +++ b/lib/libcrypto/dsa/dsa_ameth.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dsa_ameth.c,v 1.40 2023/03/04 21:02:21 tb Exp $ */ +/* $OpenBSD: dsa_ameth.c,v 1.41 2023/03/04 21:08:14 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006. */ @@ -506,9 +506,9 @@ old_dsa_priv_decode(EVP_PKEY *pkey, const unsigned char **pder, int derlen) BN_CTX *ctx = NULL; BIGNUM *j, *p1, *newp1, *powg; - if (!(dsa = d2i_DSAPrivateKey(NULL, pder, derlen))) { + if ((dsa = d2i_DSAPrivateKey(NULL, pder, derlen)) == NULL) { DSAerror(ERR_R_DSA_LIB); - return 0; + goto err; } if (!dsa_check_key(dsa)) -- 2.20.1