summaryrefslogtreecommitdiff
path: root/extra/yassl/src/ssl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'extra/yassl/src/ssl.cpp')
-rw-r--r--extra/yassl/src/ssl.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/extra/yassl/src/ssl.cpp b/extra/yassl/src/ssl.cpp
index 70198af79b4..c1d9ac81919 100644
--- a/extra/yassl/src/ssl.cpp
+++ b/extra/yassl/src/ssl.cpp
@@ -39,6 +39,7 @@
#include "coding.hpp" // HexDecoder
#include "helpers.hpp" // for placement new hack
#include <stdio.h>
+#include <assert.h>
#ifdef _WIN32
#include <windows.h> // FindFirstFile etc..
@@ -58,6 +59,9 @@ int read_file(SSL_CTX* ctx, const char* file, int format, CertType type)
if (format != SSL_FILETYPE_ASN1 && format != SSL_FILETYPE_PEM)
return SSL_BAD_FILETYPE;
+ if (file == NULL || !file[0])
+ return SSL_BAD_FILE;
+
FILE* input = fopen(file, "rb");
if (!input)
return SSL_BAD_FILE;
@@ -229,7 +233,7 @@ void SSL_free(SSL* ssl)
}
-int SSL_set_fd(SSL* ssl, int fd)
+int SSL_set_fd(SSL* ssl, socket_t fd)
{
ssl->useSocket().set_fd(fd);
return SSL_SUCCESS;
@@ -950,7 +954,7 @@ void ERR_print_errors_fp(FILE* /*fp*/)
char* ERR_error_string(unsigned long errNumber, char* buffer)
{
- static char* msg = "Please supply a buffer for error string";
+ static char* msg = (char*) "Please supply a buffer for error string";
if (buffer) {
SetErrorString(YasslError(errNumber), buffer);