diff options
author | Theo Buehler <tb@cvs.openbsd.org> | 2023-04-28 15:16:49 +0000 |
---|---|---|
committer | Theo Buehler <tb@cvs.openbsd.org> | 2023-04-28 15:16:49 +0000 |
commit | 9f037dc516c780c8f375d2670a660730daf15de5 (patch) | |
tree | cd52bfff1953deaefc2dc1024a44618cbeb2d3c2 /lib/libcrypto/x509 | |
parent | cb1ef356b24ce5b2acfd602f1b9e33e3ef0fbc72 (diff) |
Deassert x509_policy_new()
Turn the check into an error which will make all callers error.
with beck
ok jsing
Diffstat (limited to 'lib/libcrypto/x509')
-rw-r--r-- | lib/libcrypto/x509/x509_policy.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/libcrypto/x509/x509_policy.c b/lib/libcrypto/x509/x509_policy.c index 32ee4e9f4ff..c8f9447e4f6 100644 --- a/lib/libcrypto/x509/x509_policy.c +++ b/lib/libcrypto/x509/x509_policy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_policy.c,v 1.16 2023/04/28 09:56:09 tb Exp $ */ +/* $OpenBSD: x509_policy.c,v 1.17 2023/04/28 15:16:48 tb Exp $ */ /* * Copyright (c) 2022, Google Inc. * @@ -203,9 +203,10 @@ x509_policy_node_free(X509_POLICY_NODE *node) static X509_POLICY_NODE * x509_policy_node_new(const ASN1_OBJECT *policy) { - assert(!is_any_policy(policy)); - X509_POLICY_NODE *node; + X509_POLICY_NODE *node = NULL; + if (is_any_policy(policy)) + goto err; if ((node = calloc(1, sizeof(*node))) == NULL) goto err; if ((node->policy = OBJ_dup(policy)) == NULL) |