summaryrefslogtreecommitdiffstats
path: root/crypto/asn1
diff options
context:
space:
mode:
authorPeiwei Hu <jlu.hpw@foxmail.com>2021-11-14 23:00:00 +0800
committerTomas Mraz <tomas@openssl.org>2021-11-22 15:21:56 +0100
commit8db2ffc4facdf0d5a420d838b890b3a7cd011227 (patch)
treec35f9ea0225e781b712d0ec317563ab260bc46a0 /crypto/asn1
parentf169b1e685bc242d21a36c582ea3f740d24592ba (diff)
asn1_item_embed_d2i: fix th return check
Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17028) (cherry picked from commit 7f608e4b1d9473258445144ba66216fb0e63aebe)
Diffstat (limited to 'crypto/asn1')
-rw-r--r--crypto/asn1/tasn_dec.c4
1 files changed, 2 insertions, 2 deletions
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));