From ac6279297067b86ce578c3447a729a78c16828a7 Mon Sep 17 00:00:00 2001 From: Aaron Jones Date: Thu, 15 Sep 2016 12:38:00 +0000 Subject: [PATCH] MbedTLS: Correct NULL checks for functions in line with other backends --- libratbox/src/mbedtls.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libratbox/src/mbedtls.c b/libratbox/src/mbedtls.c index 92b2369b..00339bc6 100644 --- a/libratbox/src/mbedtls.c +++ b/libratbox/src/mbedtls.c @@ -534,6 +534,9 @@ rb_get_ssl_strerror(rb_fde_t *const F) int rb_get_ssl_certfp(rb_fde_t *const F, uint8_t certfp[const RB_SSL_CERTFP_LEN], int method) { + if(F == NULL || F->ssl == NULL) + return 0; + mbedtls_md_type_t md_type; int hashlen; @@ -590,7 +593,7 @@ rb_get_ssl_info(char *const buf, size_t len) const char * rb_ssl_get_cipher(rb_fde_t *const F) { - if(F == NULL || F->ssl == NULL || SSL_P(F) == NULL) + if(F == NULL || F->ssl == NULL) return NULL; static char buf[512];