]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
ASN1_item_verify_ctx(): Return -1 on fatal errors
authorTomas Mraz <tomas@openssl.org>
Thu, 6 Jun 2024 13:36:00 +0000 (15:36 +0200)
committerTomas Mraz <tomas@openssl.org>
Fri, 21 Jun 2024 08:05:54 +0000 (10:05 +0200)
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)

crypto/asn1/a_verify.c

index 9bf9bdd14ecc56964efde47ca1227d08c2a13aa5..c74b37e69743cfc583f8a59ba7baad5454be0988 100644 (file)
@@ -203,10 +203,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_MALLOC_FAILURE);
+        ret = -1;
         goto err;
     }
     inll = inl;