diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-06-19 17:44:15 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-06-19 17:44:15 +0000 |
commit | 6dd259d216c14ddd99b2b9b96beddfd1153b7387 (patch) | |
tree | 9310a1784d981e69d93f1e961f536fee947d8dcd | |
parent | 0ef1eadb3f46b71517fe444de0a5176272f6e26c (diff) | |
download | libmicrohttpd-6dd259d216c14ddd99b2b9b96beddfd1153b7387.tar.gz libmicrohttpd-6dd259d216c14ddd99b2b9b96beddfd1153b7387.zip |
Mike Crowe:
According to the libcurl documentation the parameter to curl_version_info
should be CURLVERSION_NOW rather than a bit value from the features
bitmask.
Also, on my installation at least libssh_version is NULL so the check
segfaults. It would seem that ssl_version is a more appropriate field to
check.
Finally, if libcurl lacks SSL support them ssl_version may be NULL. Make sure we
don't segfault inside strcasestr if that is the case.
-rw-r--r-- | src/testcurl/https/tls_multi_thread_mode_test.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/testcurl/https/tls_multi_thread_mode_test.c b/src/testcurl/https/tls_multi_thread_mode_test.c index ee5a8d12..28fdfcd4 100644 --- a/src/testcurl/https/tls_multi_thread_mode_test.c +++ b/src/testcurl/https/tls_multi_thread_mode_test.c | |||
@@ -126,11 +126,18 @@ int | |||
126 | main (int argc, char *const *argv) | 126 | main (int argc, char *const *argv) |
127 | { | 127 | { |
128 | unsigned int errorCount = 0; | 128 | unsigned int errorCount = 0; |
129 | const char *ssl_version; | ||
129 | 130 | ||
130 | /* initialize random seed used by curl clients */ | 131 | /* initialize random seed used by curl clients */ |
131 | unsigned int iseed = (unsigned int) time (NULL); | 132 | unsigned int iseed = (unsigned int) time (NULL); |
132 | srand (iseed); | 133 | srand (iseed); |
133 | if (NULL != strcasestr (curl_version_info (CURL_VERSION_SSL)->libssh_version, "openssl")) | 134 | ssl_version = curl_version_info (CURLVERSION_NOW)->ssl_version; |
135 | if (NULL == ssl_version) | ||
136 | { | ||
137 | fprintf (stderr, "Curl does not support SSL. Cannot run the test.\n"); | ||
138 | return 0; | ||
139 | } | ||
140 | if (NULL != strcasestr (ssl_version, "openssl")) | ||
134 | { | 141 | { |
135 | fprintf (stderr, "Refusing to run test with OpenSSL. Please install libcurl-gnutls\n"); | 142 | fprintf (stderr, "Refusing to run test with OpenSSL. Please install libcurl-gnutls\n"); |
136 | return 0; | 143 | return 0; |