From 27cc5f1a975c03d9bb2fc7923f1ad267eb4cc4ab Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 10 Aug 2018 17:43:31 +0200 Subject: openssl: fix potential NULL pointer deref in is_pkcs11_uri Follow-up to 298d2565e Coverity CID 1438387 --- lib/vtls/openssl.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'lib/vtls') diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index f747db9ac..78ee7e4f7 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -564,12 +564,7 @@ static int ssl_ui_writer(UI *ui, UI_STRING *uis) */ static bool is_pkcs11_uri(const char *string) { - if(strncasecompare(string, "pkcs11:", 7)) { - return TRUE; - } - else { - return FALSE; - } + return (string && strncasecompare(string, "pkcs11:", 7)); } #endif -- cgit v1.2.3