mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-07-05 19:00:49 +02:00
Add explicit casts
This commit is contained in:
+5
-5
@@ -4243,7 +4243,7 @@ static int ProcessClientHello(const byte* input, int* sslBytes,
|
||||
const byte *identity, *binders;
|
||||
|
||||
idsLen = (word16)((input[idx] << 8) | input[idx+1]);
|
||||
if (idsLen + OPAQUE16_LEN + idx > extLen) {
|
||||
if ((word32)idsLen + OPAQUE16_LEN + idx > (word32)extLen) {
|
||||
SetError(CLIENT_HELLO_INPUT_STR, error, session, FATAL_ERROR_STATE);
|
||||
return WOLFSSL_FATAL_ERROR;
|
||||
}
|
||||
@@ -4251,7 +4251,7 @@ static int ProcessClientHello(const byte* input, int* sslBytes,
|
||||
|
||||
/* PSK identity */
|
||||
idLen = (word16)((input[idx] << 8) | input[idx+1]);
|
||||
if (idLen + OPAQUE16_LEN + idx > extLen) {
|
||||
if ((word32)idLen + OPAQUE16_LEN + idx > (word32)extLen) {
|
||||
SetError(CLIENT_HELLO_INPUT_STR, error, session, FATAL_ERROR_STATE);
|
||||
return WOLFSSL_FATAL_ERROR;
|
||||
}
|
||||
@@ -4260,7 +4260,7 @@ static int ProcessClientHello(const byte* input, int* sslBytes,
|
||||
idx += idLen;
|
||||
|
||||
/* Obfuscated Ticket Age 32-bits */
|
||||
if (idx + OPAQUE32_LEN > extLen) {
|
||||
if ((word32)idx + OPAQUE32_LEN > (word32)extLen) {
|
||||
SetError(CLIENT_HELLO_INPUT_STR, error, session, FATAL_ERROR_STATE);
|
||||
return WOLFSSL_FATAL_ERROR;
|
||||
}
|
||||
@@ -4270,12 +4270,12 @@ static int ProcessClientHello(const byte* input, int* sslBytes,
|
||||
idx += OPAQUE32_LEN;
|
||||
|
||||
/* binders - all binders */
|
||||
if (idx + OPAQUE16_LEN > extLen) {
|
||||
if ((word32)idx + OPAQUE16_LEN > (word32)extLen) {
|
||||
SetError(CLIENT_HELLO_INPUT_STR, error, session, FATAL_ERROR_STATE);
|
||||
return WOLFSSL_FATAL_ERROR;
|
||||
}
|
||||
bindersLen = (word16)((input[idx] << 8) | input[idx+1]);
|
||||
if (bindersLen + OPAQUE16_LEN + idx > extLen) {
|
||||
if ((word32)bindersLen + OPAQUE16_LEN + idx > (word32)extLen) {
|
||||
SetError(CLIENT_HELLO_INPUT_STR, error, session, FATAL_ERROR_STATE);
|
||||
return WOLFSSL_FATAL_ERROR;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user