]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix BIO_set_indent() check
authorNiels Dossche <niels.dossche@ugent.be>
Wed, 1 Feb 2023 14:06:12 +0000 (15:06 +0100)
committerTomas Mraz <tomas@openssl.org>
Wed, 8 Feb 2023 16:03:52 +0000 (17:03 +0100)
This function returns an errorcode <= 0, but only < 0 is checked. Other
callers that check the return value perform this check correctly. Fix it
by changing the check to <= 0.

CLA: trivial

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20186)

crypto/asn1/asn1_parse.c

index 04d7ef66cfc917536022e882f5469a8afb1af6ab..b565a166475145e7119e7ad5c88817f370cfb33a 100644 (file)
@@ -50,7 +50,7 @@ static int asn1_print_info(BIO *bp, long offset, int depth, int hl, long len,
             pop_f_prefix = 1;
         }
         saved_indent = BIO_get_indent(bp);
-        if (BIO_set_prefix(bp, str) <= 0 || BIO_set_indent(bp, indent) < 0)
+        if (BIO_set_prefix(bp, str) <= 0 || BIO_set_indent(bp, indent) <= 0)
             goto err;
     }