libmicrohttpd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] [PATCH 2/2] tls_multi_thread_mode_test: Don't segfault i


From: Mike Crowe
Subject: [libmicrohttpd] [PATCH 2/2] tls_multi_thread_mode_test: Don't segfault if there's no SSL
Date: Tue, 19 Jun 2012 17:40:20 +0100

If libcurl lacks SSL support them ssl_version may be NULL. Make sure we
don't segfault inside strcasestr if that is the case.
---
 src/testcurl/https/tls_multi_thread_mode_test.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/testcurl/https/tls_multi_thread_mode_test.c 
b/src/testcurl/https/tls_multi_thread_mode_test.c
index c90f41a..b0e1534 100644
--- a/src/testcurl/https/tls_multi_thread_mode_test.c
+++ b/src/testcurl/https/tls_multi_thread_mode_test.c
@@ -130,6 +130,11 @@ main (int argc, char *const *argv)
   /* initialize random seed used by curl clients */
   unsigned int iseed = (unsigned int) time (NULL);
   srand (iseed);
+  if (NULL == curl_version_info (CURLVERSION_NOW)->ssl_version)
+  {
+    fprintf (stderr, "Refusing to run test without SSL. Please install 
libcurl-gnutls\n");
+    return 0;
+  }
   if (NULL != strcasestr (curl_version_info (CURLVERSION_NOW)->ssl_version, 
"openssl"))
   {
     fprintf (stderr, "Refusing to run test with OpenSSL.  Please install 
libcurl-gnutls\n");
-- 
1.7.10




reply via email to

[Prev in Thread] Current Thread [Next in Thread]