diff options
author | Clemens Lang <cllang@redhat.com> | 2023-05-24 13:12:54 +0200 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2023-05-29 14:52:27 +0200 |
commit | 95a8aa6dc0e283b1560dd3258d2e9115c02659b1 (patch) | |
tree | 6dbf7a1cc52dff901c7cd2439dec3aaa39f0ff16 /include | |
parent | de53817ec386ea9e943d8f33716945dd9dbe1f31 (diff) |
x509: Handle ossl_policy_level_add_node errors
The invocation of ossl_policy_level_add_node in tree_calculate_user_set
did not have any error handling. Add it to prevent a memory leak for the
allocated extra policy data.
Also add error handling to sk_X509_POLICY_NODE_push to ensure that if
a new node was allocated, but could not be added to the stack, it is
freed correctly.
Fix error handling if tree->user_policies cannot be allocated by
returning 0, indicating failure, rather than 1.
Signed-off-by: Clemens Lang <cllang@redhat.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21040)
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions