From: Daniel Stenberg Date: Fri, 10 Aug 2018 15:43:31 +0000 (+0200) Subject: openssl: fix potential NULL pointer deref in is_pkcs11_uri X-Git-Tag: curl-7_61_1~75 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=27cc5f1a975c03d9bb2fc7923f1ad267eb4cc4ab;p=thirdparty%2Fcurl.git openssl: fix potential NULL pointer deref in is_pkcs11_uri Follow-up to 298d2565e Coverity CID 1438387 --- diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index f747db9ac9..78ee7e4f74 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