]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
openssl: fix potential NULL pointer deref in is_pkcs11_uri
authorDaniel Stenberg <daniel@haxx.se>
Fri, 10 Aug 2018 15:43:31 +0000 (17:43 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 10 Aug 2018 15:44:57 +0000 (17:44 +0200)
Follow-up to 298d2565e
Coverity CID 1438387

lib/vtls/openssl.c

index f747db9ac9b50913f84edced27341e8eef6fcf97..78ee7e4f742b5fc67ba46f85a8349e0e462d5e0c 100644 (file)
@@ -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