From 8db2ffc4facdf0d5a420d838b890b3a7cd011227 Mon Sep 17 00:00:00 2001 From: Peiwei Hu Date: Sun, 14 Nov 2021 23:00:00 +0800 Subject: asn1_item_embed_d2i: fix th return check Reviewed-by: Paul Dale Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/17028) (cherry picked from commit 7f608e4b1d9473258445144ba66216fb0e63aebe) --- crypto/asn1/tasn_dec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crypto/asn1') diff --git a/crypto/asn1/tasn_dec.c b/crypto/asn1/tasn_dec.c index eff67d87fc..11198087a5 100644 --- a/crypto/asn1/tasn_dec.c +++ b/crypto/asn1/tasn_dec.c @@ -648,9 +648,9 @@ static int asn1_template_noexp_d2i(ASN1_VALUE **val, break; } skfield = NULL; - if (!asn1_item_embed_d2i(&skfield, &p, len, + if (asn1_item_embed_d2i(&skfield, &p, len, ASN1_ITEM_ptr(tt->item), -1, 0, 0, ctx, - depth, libctx, propq)) { + depth, libctx, propq) <= 0) { ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR); /* |skfield| may be partially allocated despite failure. */ ASN1_item_free(skfield, ASN1_ITEM_ptr(tt->item)); -- cgit v1.2.3