summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/libcrypto/x509/x509_vpm.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/lib/libcrypto/x509/x509_vpm.c b/src/lib/libcrypto/x509/x509_vpm.c
index 674c8e445c..62d9215b4c 100644
--- a/src/lib/libcrypto/x509/x509_vpm.c
+++ b/src/lib/libcrypto/x509/x509_vpm.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_vpm.c,v 1.43 2024/03/29 00:25:32 tb Exp $ */ 1/* $OpenBSD: x509_vpm.c,v 1.44 2024/03/29 04:45:15 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 2004. 3 * project 2004.
4 */ 4 */
@@ -464,12 +464,11 @@ LCRYPTO_ALIAS(X509_VERIFY_PARAM_set_time);
464int 464int
465X509_VERIFY_PARAM_add0_policy(X509_VERIFY_PARAM *param, ASN1_OBJECT *policy) 465X509_VERIFY_PARAM_add0_policy(X509_VERIFY_PARAM *param, ASN1_OBJECT *policy)
466{ 466{
467 if (!param->policies) { 467 if (param->policies == NULL)
468 param->policies = sk_ASN1_OBJECT_new_null(); 468 param->policies = sk_ASN1_OBJECT_new_null();
469 if (!param->policies) 469 if (param->policies == NULL)
470 return 0; 470 return 0;
471 } 471 if (sk_ASN1_OBJECT_push(param->policies, policy) <= 0)
472 if (!sk_ASN1_OBJECT_push(param->policies, policy))
473 return 0; 472 return 0;
474 return 1; 473 return 1;
475} 474}