Commit db0fe094a8 for openssl.org
commit db0fe094a8c28df233f328c0ae58ad874a728c6f
Author: Norbert Pocs <norbertp@openssl.org>
Date: Tue Mar 31 17:06:36 2026 +0200
ASN1_BIT_STRING_name_print check BIO_* RVs
Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Saša NedvÄ›dický <sashan@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
MergeDate: Fri Apr 17 10:44:19 2026
(Merged from https://github.com/openssl/openssl/pull/30691)
diff --git a/crypto/asn1/t_bitst.c b/crypto/asn1/t_bitst.c
index bee3f78543..4982dba590 100644
--- a/crypto/asn1/t_bitst.c
+++ b/crypto/asn1/t_bitst.c
@@ -19,7 +19,8 @@ int ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs,
char first = 1;
int last_seen_bit = -1;
- BIO_printf(out, "%*s", indent, "");
+ if (BIO_printf(out, "%*s", indent, "") < 0)
+ return 0;
for (bnam = tbl; bnam->lname; bnam++) {
/*
* Skip duplicate entries for the same bit in the BIT_STRING_BITNAME
@@ -32,12 +33,15 @@ int ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs,
if (ASN1_BIT_STRING_get_bit(bs, bnam->bitnum)) {
if (!first)
- BIO_puts(out, ", ");
- BIO_puts(out, bnam->lname);
+ if (BIO_puts(out, ", ") < 1)
+ return 0;
+ if (BIO_puts(out, bnam->lname) < 1)
+ return 0;
first = 0;
}
}
- BIO_puts(out, "\n");
+ if (BIO_puts(out, "\n") < 1)
+ return 0;
return 1;
}