diff --git a/scripts/ocsp-stapling.test b/scripts/ocsp-stapling.test index 28c99b936c8..f4f6b506641 100755 --- a/scripts/ocsp-stapling.test +++ b/scripts/ocsp-stapling.test @@ -526,7 +526,8 @@ generate_port() { while true; do if [[ "$OSTYPE" == "linux"* || "$OSTYPE" == "msys" - || "$OSTYPE" == "cygwin"* ]]; then + || "$OSTYPE" == "cygwin"* + || "$OSTYPE" == "solaris"* ]]; then p=$(($(od -An -N2 /dev/urandom) % (65535-49512) + 49512)) elif [[ "$OSTYPE" == "darwin"* ]]; then p=$(($(od -An -N2 /dev/random) % (65535-49512) + 49512)) diff --git a/scripts/ocsp-stapling2.test b/scripts/ocsp-stapling2.test index 80740a7744b..a838ef22625 100755 --- a/scripts/ocsp-stapling2.test +++ b/scripts/ocsp-stapling2.test @@ -524,7 +524,8 @@ generate_port() { while true; do if [[ "$OSTYPE" == "linux"* || "$OSTYPE" == "msys" - || "$OSTYPE" == "cygwin" ]]; then + || "$OSTYPE" == "cygwin" + || "$OSTYPE" == "solaris"* ]]; then p=$(($(od -An -N2 /dev/urandom) % (65535-49512) + 49512)) elif [[ "$OSTYPE" == "darwin"* ]]; then p=$(($(od -An -N2 /dev/random) % (65535-49512) + 49512)) diff --git a/scripts/openssl.test b/scripts/openssl.test index 270c25862da..cc0c95d3474 100755 --- a/scripts/openssl.test +++ b/scripts/openssl.test @@ -73,7 +73,7 @@ generate_port() { local attempts=0 collision p while true; do - if [[ "$OSTYPE" == "linux"* ]]; then + if [[ "$OSTYPE" == "linux"* || "$OSTYPE" == "solaris"* ]]; then p=$(($(od -An -N2 /dev/urandom) % (65535-49512) + 49512)) elif [[ "$OSTYPE" == "darwin"* ]]; then p=$(($(od -An -N2 /dev/random) % (65535-49512) + 49512)) diff --git a/scripts/openssl_srtp.test b/scripts/openssl_srtp.test index a882c3f81df..28e8df2682f 100755 --- a/scripts/openssl_srtp.test +++ b/scripts/openssl_srtp.test @@ -51,7 +51,7 @@ generate_port() { local attempts=0 collision p while true; do - if [[ "$OSTYPE" == "linux"* ]]; then + if [[ "$OSTYPE" == "linux"* || "$OSTYPE" == "solaris"* ]]; then p=$(($(od -An -N2 /dev/urandom) % (65535-49512) + 49512)) elif [[ "$OSTYPE" == "darwin"* ]]; then p=$(($(od -An -N2 /dev/random) % (65535-49512) + 49512)) diff --git a/tests/api.c b/tests/api.c index 3874969255e..d20e20cbef0 100644 --- a/tests/api.c +++ b/tests/api.c @@ -44865,11 +44865,11 @@ static int test_sniffer_chain_input_overflow(void) * into an int, causing an undersized allocation followed by an oversized * copy (heap buffer overflow). After the fix, the function should detect * the overflow and return an error without allocating or copying. */ - chain[0].iov_base = dummy; + chain[0].iov_base = (void*)dummy; chain[0].iov_len = (size_t)0x80000000UL; /* 2GB */ - chain[1].iov_base = dummy; + chain[1].iov_base = (void*)dummy; chain[1].iov_len = (size_t)0x80000000UL; /* 2GB */ - chain[2].iov_base = dummy; + chain[2].iov_base = (void*)dummy; chain[2].iov_len = (size_t)0x80000000UL; /* 2GB */ XMEMSET(error, 0, sizeof(error)); diff --git a/tests/api/test_ssl_rw.c b/tests/api/test_ssl_rw.c index 0ef91a2bbae..4c992da4f74 100644 --- a/tests/api/test_ssl_rw.c +++ b/tests/api/test_ssl_rw.c @@ -173,9 +173,9 @@ int test_wolfSSL_writev(void) /* A total length that overflows is rejected. The buffers are never read * so the bogus length is safe. */ - iov[0].iov_base = msg; + iov[0].iov_base = (void*)msg; iov[0].iov_len = (size_t)-1; - iov[1].iov_base = msg; + iov[1].iov_base = (void*)msg; iov[1].iov_len = 2; ExpectIntEQ(wolfSSL_writev(ssl_c, iov, 2), WC_NO_ERR_TRACE(BUFFER_E)); @@ -193,11 +193,11 @@ int test_wolfSSL_writev(void) /* Segments totalling less than FILE_BUFFER_SIZE use the static buffer. */ small_sz = 96; - iov[0].iov_base = msg; + iov[0].iov_base = (void*)msg; iov[0].iov_len = 32; - iov[1].iov_base = msg + 32; + iov[1].iov_base = (void*)(msg + 32); iov[1].iov_len = 32; - iov[2].iov_base = msg + 64; + iov[2].iov_base = (void*)(msg + 64); iov[2].iov_len = 32; ExpectIntEQ(wolfSSL_writev(ssl_c, iov, 3), small_sz); XMEMSET(reply, 0, sizeof(reply)); @@ -206,9 +206,9 @@ int test_wolfSSL_writev(void) /* Segments totalling more than FILE_BUFFER_SIZE allocate from the heap. */ large_sz = (int)sizeof(msg); - iov[0].iov_base = msg; + iov[0].iov_base = (void*)msg; iov[0].iov_len = 64; - iov[1].iov_base = msg + 64; + iov[1].iov_base = (void*)(msg + 64); iov[1].iov_len = (size_t)large_sz - 64; ExpectIntEQ(wolfSSL_writev(ssl_c, iov, 2), large_sz); XMEMSET(reply, 0, sizeof(reply));