From 73af251f8d8df085aba437aef7f6d763c349a841 Mon Sep 17 00:00:00 2001 From: tb <> Date: Wed, 15 Mar 2023 06:22:42 +0000 Subject: Error check BIO_asn1_set_{prefix,suffix}() calls ok jsing --- src/lib/libcrypto/asn1/bio_ndef.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/lib/libcrypto/asn1/bio_ndef.c b/src/lib/libcrypto/asn1/bio_ndef.c index d6642e573e..7c8428f606 100644 --- a/src/lib/libcrypto/asn1/bio_ndef.c +++ b/src/lib/libcrypto/asn1/bio_ndef.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bio_ndef.c,v 1.17 2023/03/13 07:31:09 tb Exp $ */ +/* $OpenBSD: bio_ndef.c,v 1.18 2023/03/15 06:22:42 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project. */ @@ -120,8 +120,10 @@ BIO_new_NDEF(BIO *out, ASN1_VALUE *val, const ASN1_ITEM *it) goto err; pop_bio = asn_bio; - BIO_asn1_set_prefix(asn_bio, ndef_prefix, ndef_prefix_free); - BIO_asn1_set_suffix(asn_bio, ndef_suffix, ndef_suffix_free); + if (BIO_asn1_set_prefix(asn_bio, ndef_prefix, ndef_prefix_free) <= 0) + goto err; + if (BIO_asn1_set_suffix(asn_bio, ndef_suffix, ndef_suffix_free) <= 0) + goto err; /* Now let callback prepend any digest, cipher etc BIOs * ASN1 structure needs. -- cgit v1.2.3-55-g6feb