]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
test: fix coverity 1469427 Improper use of negative value (NEGATIVE_RETURNS)
authorPauli <pauli@openssl.org>
Mon, 28 Jun 2021 21:59:00 +0000 (07:59 +1000)
committerPauli <pauli@openssl.org>
Wed, 30 Jun 2021 03:55:09 +0000 (13:55 +1000)
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15943)

test/endecoder_legacy_test.c

index 121e2de3d4e622c39cf3a71e2cd6c986523d6290..943cba56e59f5b2a79eb75582a62b791a9fc858f 100644 (file)
@@ -289,7 +289,8 @@ static int test_membio_str_eq(BIO *bio_provided, BIO *bio_legacy)
     long len_provided = BIO_get_mem_data(bio_provided, &str_provided);
     long len_legacy = BIO_get_mem_data(bio_legacy, &str_legacy);
 
-    return TEST_long_ge(len_provided, 0)
+    return TEST_long_ge(len_legacy, 0)
+           && TEST_long_ge(len_provided, 0)
            && TEST_strn2_eq(str_provided, len_provided,
                             str_legacy, len_legacy);
 }