summaryrefslogtreecommitdiffstats
path: root/crypto/bio
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2012-06-11 08:52:11 +0000
committerAndy Polyakov <appro@openssl.org>2014-02-01 22:33:02 +0100
commitd451ece4e7edce8c954daa084c83686647dcda0f (patch)
tree87a0ddae631846057538b3c555594d636d5fbae6 /crypto/bio
parent1121ba1b74f4ac132aa36e6363ac3c3c2e23bfb6 (diff)
b_sock.c: make getsockopt work in cases when optlen is 64-bit value.
(cherry picked from commit 80c42f3e0c34451dd7cfc65e07bc639759ef07d2)
Diffstat (limited to 'crypto/bio')
-rw-r--r--crypto/bio/b_sock.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/crypto/bio/b_sock.c b/crypto/bio/b_sock.c
index 41f958be71..a026b3e0b0 100644
--- a/crypto/bio/b_sock.c
+++ b/crypto/bio/b_sock.c
@@ -233,13 +233,14 @@ int BIO_get_port(const char *str, unsigned short *port_ptr)
int BIO_sock_error(int sock)
{
int j,i;
- int size;
+ union { size_t s; int i; } size;
#if defined(OPENSSL_SYS_BEOS_R5)
return 0;
#endif
-
- size=sizeof(int);
+
+ /* heuristic way to adapt for platforms that expect 64-bit optlen */
+ size.s=0, size.i=sizeof(j);
/* Note: under Windows the third parameter is of type (char *)
* whereas under other systems it is (void *) if you don't have
* a cast it will choke the compiler: if you do have a cast then