From ac59d70553723cd8c7c1558071a2e1672d80daef Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Fri, 6 Mar 2015 14:39:46 +0000 Subject: apps return value checks Ensure that all libssl functions called from within the apps have their return values checked where appropriate. Reviewed-by: Richard Levitte --- apps/s_cb.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'apps/s_cb.c') diff --git a/apps/s_cb.c b/apps/s_cb.c index 8a66c9a7dc..8bc4b81710 100644 --- a/apps/s_cb.c +++ b/apps/s_cb.c @@ -1181,8 +1181,10 @@ static int set_cert_cb(SSL *ssl, void *arg) print_chain_flags(bio_err, ssl, rv); if (rv & CERT_PKEY_VALID) { - SSL_use_certificate(ssl, exc->cert); - SSL_use_PrivateKey(ssl, exc->key); + if(!SSL_use_certificate(ssl, exc->cert) + || !SSL_use_PrivateKey(ssl, exc->key)) { + return 0; + } /* * NB: we wouldn't normally do this as it is not efficient * building chains on each connection better to cache the chain -- cgit v1.2.1