From: Pauli Date: Sun, 4 Apr 2021 08:00:26 +0000 (+1000) Subject: test: fix coverity 1475940: negative return X-Git-Tag: openssl-3.0.0-alpha14~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=014498fff9ee2e71dfdd82978b8896b05c9c8cb0;p=thirdparty%2Fopenssl.git test: fix coverity 1475940: negative return Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/14769) --- diff --git a/test/dhtest.c b/test/dhtest.c index 294c9e3f567..189b5ae13ff 100644 --- a/test/dhtest.c +++ b/test/dhtest.c @@ -249,9 +249,9 @@ static int dh_computekey_range_test(void) || !TEST_true(DH_set0_pqg(dh, p, q, g))) goto err; p = q = g = NULL; - sz = DH_size(dh); - if (!TEST_ptr(buf = OPENSSL_malloc(sz)) + if (!TEST_int_gt(sz = DH_size(dh), 0) + || !TEST_ptr(buf = OPENSSL_malloc(sz)) || !TEST_ptr(pub = BN_new()) || !TEST_ptr(priv = BN_new())) goto err;