diff options
author | Theo Buehler <tb@cvs.openbsd.org> | 2023-03-15 06:22:43 +0000 |
---|---|---|
committer | Theo Buehler <tb@cvs.openbsd.org> | 2023-03-15 06:22:43 +0000 |
commit | c709057481a1c3cb7ef1978e324042aa0b5ab48a (patch) | |
tree | beda2ba9a9ba2a2b1a1f2b4c8eaeb41ccb4290b6 /lib/libcrypto/asn1 | |
parent | 8dc85461b1e5d3c8bc60bbabeb9b527c63d69d68 (diff) |
Error check BIO_asn1_set_{prefix,suffix}() calls
ok jsing
Diffstat (limited to 'lib/libcrypto/asn1')
-rw-r--r-- | lib/libcrypto/asn1/bio_ndef.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/libcrypto/asn1/bio_ndef.c b/lib/libcrypto/asn1/bio_ndef.c index d6642e573ee..7c8428f606c 100644 --- a/lib/libcrypto/asn1/bio_ndef.c +++ b/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. |