mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 10:47:28 +02:00
fix strict-aliasing rules warning
This commit is contained in:
12
tests/api.c
12
tests/api.c
@ -69194,6 +69194,8 @@ static int test_tls_multi_handshakes_one_record(void)
|
|||||||
struct test_memio_ctx test_ctx;
|
struct test_memio_ctx test_ctx;
|
||||||
WOLFSSL_CTX *ctx_c = NULL, *ctx_s = NULL;
|
WOLFSSL_CTX *ctx_c = NULL, *ctx_s = NULL;
|
||||||
WOLFSSL *ssl_c = NULL, *ssl_s = NULL;
|
WOLFSSL *ssl_c = NULL, *ssl_s = NULL;
|
||||||
|
RecordLayerHeader* rh = NULL;
|
||||||
|
byte *len ;
|
||||||
int newRecIdx = RECORD_HEADER_SZ;
|
int newRecIdx = RECORD_HEADER_SZ;
|
||||||
int idx = 0;
|
int idx = 0;
|
||||||
|
|
||||||
@ -69211,7 +69213,10 @@ static int test_tls_multi_handshakes_one_record(void)
|
|||||||
while (idx < test_ctx.c_len) {
|
while (idx < test_ctx.c_len) {
|
||||||
word16 recLen;
|
word16 recLen;
|
||||||
|
|
||||||
ato16(((RecordLayerHeader*)(test_ctx.c_buff + idx))->length, &recLen);
|
rh = (RecordLayerHeader*)(test_ctx.c_buff + idx);
|
||||||
|
len = &rh->length[0];
|
||||||
|
|
||||||
|
ato16((const byte*)len, &recLen);
|
||||||
idx += RECORD_HEADER_SZ;
|
idx += RECORD_HEADER_SZ;
|
||||||
|
|
||||||
XMEMMOVE(test_ctx.c_buff + newRecIdx, test_ctx.c_buff + idx,
|
XMEMMOVE(test_ctx.c_buff + newRecIdx, test_ctx.c_buff + idx,
|
||||||
@ -69220,8 +69225,9 @@ static int test_tls_multi_handshakes_one_record(void)
|
|||||||
newRecIdx += recLen;
|
newRecIdx += recLen;
|
||||||
idx += recLen;
|
idx += recLen;
|
||||||
}
|
}
|
||||||
c16toa(newRecIdx - RECORD_HEADER_SZ,
|
rh = (RecordLayerHeader*)(test_ctx.c_buff);
|
||||||
((RecordLayerHeader*)test_ctx.c_buff)->length);
|
len = &rh->length[0];
|
||||||
|
c16toa(newRecIdx - RECORD_HEADER_SZ, len);
|
||||||
test_ctx.c_len = newRecIdx;
|
test_ctx.c_len = newRecIdx;
|
||||||
|
|
||||||
ExpectIntEQ(wolfSSL_connect(ssl_c), -1);
|
ExpectIntEQ(wolfSSL_connect(ssl_c), -1);
|
||||||
|
Reference in New Issue
Block a user