summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/x509/x509_cpols.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/lib/libcrypto/x509/x509_cpols.c b/src/lib/libcrypto/x509/x509_cpols.c
index e075f462ad..25a40b0739 100644
--- a/src/lib/libcrypto/x509/x509_cpols.c
+++ b/src/lib/libcrypto/x509/x509_cpols.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_cpols.c,v 1.19 2025/11/03 16:36:15 tb Exp $ */ 1/* $OpenBSD: x509_cpols.c,v 1.20 2025/11/28 06:03:40 tb Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 1999. 3 * project 1999.
4 */ 4 */
@@ -676,23 +676,18 @@ nref_nos(STACK_OF(ASN1_INTEGER) *nnums, STACK_OF(CONF_VALUE) *nos)
676 676
677 for (i = 0; i < sk_CONF_VALUE_num(nos); i++) { 677 for (i = 0; i < sk_CONF_VALUE_num(nos); i++) {
678 cnf = sk_CONF_VALUE_value(nos, i); 678 cnf = sk_CONF_VALUE_value(nos, i);
679 if (!(aint = s2i_ASN1_INTEGER(NULL, cnf->name))) { 679 if ((aint = s2i_ASN1_INTEGER(NULL, cnf->name)) == NULL) {
680 X509V3error(X509V3_R_INVALID_NUMBER); 680 X509V3error(X509V3_R_INVALID_NUMBER);
681 goto err; 681 return 0;
682 } 682 }
683 if (!sk_ASN1_INTEGER_push(nnums, aint)) { 683 if (sk_ASN1_INTEGER_push(nnums, aint) <= 0) {
684 X509V3error(ERR_R_MALLOC_FAILURE);
684 ASN1_INTEGER_free(aint); 685 ASN1_INTEGER_free(aint);
685 goto merr; 686 return 0;
686 } 687 }
687 } 688 }
688 return 1;
689
690 merr:
691 X509V3error(ERR_R_MALLOC_FAILURE);
692 689
693 err: 690 return 1;
694 sk_ASN1_INTEGER_pop_free(nnums, ASN1_INTEGER_free);
695 return 0;
696} 691}
697 692
698static int 693static int