aboutsummaryrefslogtreecommitdiff
path: root/lib/qssl.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2009-04-14 12:53:53 +0000
committerYang Tse <yangsita@gmail.com>2009-04-14 12:53:53 +0000
commitc382c550e7d8ad54d2c35b0fea9d0eef09ff3a25 (patch)
tree4a55cc0951de068e16c9e016bdb8b70fde9c6473 /lib/qssl.c
parentc663494c69e81f8d88ccf8dad7e4ae3ef726e9d8 (diff)
fix compiler warning: implicit conversion shortens 64-bit value into a 32-bit value
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) {