summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Mraz <tomas@openssl.org>2024-06-06 15:36:00 +0200
committerTomas Mraz <tomas@openssl.org>2024-06-21 10:04:27 +0200
commit711dd6ce37756b8099b5890b72d691c2c4b7b507 (patch)
tree07b3f4463fca95e7616d6f85ffb7f361683e96bf
parent72bff68f6acc4f420e283bcc77db76eb1917d7bf (diff)
ASN1_item_verify_ctx(): Return -1 on fatal errors
Fixes #24575 Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Neil Horman <nhorman@openssl.org> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> (Merged from https://github.com/openssl/openssl/pull/24576) (cherry picked from commit 8d380f85da215012570347f156e642d69909877a)
-rw-r--r--crypto/asn1/a_verify.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/crypto/asn1/a_verify.c b/crypto/asn1/a_verify.c
index 94d29e7c27..f754216eb7 100644
--- a/crypto/asn1/a_verify.c
+++ b/crypto/asn1/a_verify.c
@@ -202,10 +202,12 @@ int ASN1_item_verify_ctx(const ASN1_ITEM *it, const X509_ALGOR *alg,
inl = ASN1_item_i2d(data, &buf_in, it);
if (inl <= 0) {
ERR_raise(ERR_LIB_ASN1, ERR_R_INTERNAL_ERROR);
+ ret = -1;
goto err;
}
if (buf_in == NULL) {
ERR_raise(ERR_LIB_ASN1, ERR_R_ASN1_LIB);
+ ret = -1;
goto err;
}
inll = inl;