diff options
author | Pauli <ppzgs1@gmail.com> | 2021-04-04 10:00:26 +0200 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2021-04-07 15:30:42 +0200 |
commit | 014498fff9ee2e71dfdd82978b8896b05c9c8cb0 (patch) | |
tree | 377f2c34eadfe535afbade64623fc33db5ec95f1 /test | |
parent | test: fix coverity 1475941: resource leak (diff) | |
download | openssl-014498fff9ee2e71dfdd82978b8896b05c9c8cb0.tar.xz openssl-014498fff9ee2e71dfdd82978b8896b05c9c8cb0.zip |
test: fix coverity 1475940: negative return
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14769)
Diffstat (limited to 'test')
-rw-r--r-- | test/dhtest.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/dhtest.c b/test/dhtest.c index 294c9e3f56..189b5ae13f 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; |