From: Niels Dossche Date: Wed, 1 Feb 2023 14:06:12 +0000 (+0100) Subject: Fix BIO_set_indent() check X-Git-Tag: openssl-3.2.0-alpha1~1293 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=826374921a6b92293fd87655416eda8ef07301c8;p=thirdparty%2Fopenssl.git Fix BIO_set_indent() check 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 Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/20186) --- diff --git a/crypto/asn1/asn1_parse.c b/crypto/asn1/asn1_parse.c index 04d7ef66cfc..b565a166475 100644 --- a/crypto/asn1/asn1_parse.c +++ b/crypto/asn1/asn1_parse.c @@ -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; }