aboutsummaryrefslogtreecommitdiff
path: root/lib/qssl.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/qssl.c')
-rw-r--r--lib/qssl.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/qssl.c b/lib/qssl.c
index 2dd46c35c..bf4e5f798 100644
--- a/lib/qssl.c
+++ b/lib/qssl.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -419,9 +419,11 @@ ssize_t Curl_qsossl_recv(struct connectdata * conn, int num, char * buf,
char error_buffer[120]; /* OpenSSL documents that this must be at
least 120 bytes long. */
unsigned long sslerror;
+ int buffsize;
int nread;
- nread = SSL_Read(conn->ssl[num].handle, buf, (int) buffersize);
+ buffsize = (buffersize > (size_t)INT_MAX) ? INT_MAX : (int)buffersize;
+ nread = SSL_Read(conn->ssl[num].handle, buf, buffsize);
*wouldblock = FALSE;
if(nread < 0) {