diff options
author | Kinichiro Inoguchi <inoguchi@cvs.openbsd.org> | 2022-01-28 13:14:49 +0000 |
---|---|---|
committer | Kinichiro Inoguchi <inoguchi@cvs.openbsd.org> | 2022-01-28 13:14:49 +0000 |
commit | b04fcccd7573d23a843fc4a2ffcf19ce835b86c2 (patch) | |
tree | 6a27df69bef7b7f043f6e8cd131a6ddc655f4381 /lib/libssl | |
parent | fd7b28e70b71a8c0d94acc50ab849c29dc33017b (diff) |
Error check for sk_push in libssl
CID 118976 118979
ok tb@
Diffstat (limited to 'lib/libssl')
-rw-r--r-- | lib/libssl/ssl_cert.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/libssl/ssl_cert.c b/lib/libssl/ssl_cert.c index e91de659ce9..71daf3718bb 100644 --- a/lib/libssl/ssl_cert.c +++ b/lib/libssl/ssl_cert.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_cert.c,v 1.93 2022/01/08 12:59:58 jsing Exp $ */ +/* $OpenBSD: ssl_cert.c,v 1.94 2022/01/28 13:14:48 inoguchi Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -558,8 +558,10 @@ SSL_load_client_CA_file(const char *file) if (sk_X509_NAME_find(sk, xn) >= 0) X509_NAME_free(xn); else { - sk_X509_NAME_push(sk, xn); - sk_X509_NAME_push(ret, xn); + if (!sk_X509_NAME_push(sk, xn)) + goto err; + if (!sk_X509_NAME_push(ret, xn)) + goto err; } } @@ -619,7 +621,8 @@ SSL_add_file_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack, if (sk_X509_NAME_find(stack, xn) >= 0) X509_NAME_free(xn); else - sk_X509_NAME_push(stack, xn); + if (!sk_X509_NAME_push(stack, xn)) + goto err; } ERR_clear_error(); |