Skip to content

Commit aa56c40

Browse files
committed
Fix / suppress GCC warnings
1 parent 3f460b4 commit aa56c40

3 files changed

Lines changed: 14 additions & 13 deletions

File tree

src/internal.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25910,16 +25910,7 @@ int SendData(WOLFSSL* ssl, const void* data, size_t sz)
2591025910
}
2591125911
#endif /* WOLFSSL_DTLS13 */
2591225912

25913-
#ifdef WOLFSSL_DTLS
25914-
if (ssl->options.dtls) {
25915-
buffSz = wolfSSL_GetMaxFragSize(ssl, (word32)sz - sent);
25916-
}
25917-
else
25918-
#endif
25919-
{
25920-
buffSz = wolfSSL_GetMaxFragSize(ssl, (word32)sz - sent);
25921-
25922-
}
25913+
buffSz = wolfSSL_GetMaxFragSize(ssl, (word32)sz - sent);
2592325914

2592425915
if (sent == (word32)sz) break;
2592525916

src/ssl_bn.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,7 +1151,12 @@ int wolfSSL_BN_cmp(const WOLFSSL_BIGNUM* a, const WOLFSSL_BIGNUM* b)
11511151
ret = -1;
11521152
}
11531153
else {
1154+
PRAGMA_GCC_DIAG_PUSH
1155+
PRAGMA_GCC("GCC diagnostic ignored \"-Werror=duplicated-branches\"")
1156+
/* ignored warning here because the same return value
1157+
was intentional */
11541158
ret = WOLFSSL_FATAL_ERROR; /* also -1 */
1159+
PRAGMA_GCC_DIAG_POP
11551160
}
11561161
}
11571162

src/tls.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5329,9 +5329,14 @@ int TLSX_SupportedFFDHE_Set(WOLFSSL* ssl)
53295329
SupportedCurve* serverGroup;
53305330

53315331
ext = TLSX_Find(priority, TLSX_SUPPORTED_GROUPS);
5332-
serverGroup = (SupportedCurve*)ext->data;
5333-
5334-
ret = tlsx_ffdhe_find_group(ssl, clientGroup, serverGroup);
5332+
if (ext == NULL) {
5333+
WOLFSSL_MSG("Could not find supported groups extension");
5334+
ret = 0;
5335+
}
5336+
else {
5337+
serverGroup = (SupportedCurve*)ext->data;
5338+
ret = tlsx_ffdhe_find_group(ssl, clientGroup, serverGroup);
5339+
}
53355340
}
53365341

53375342
TLSX_FreeAll(priority, ssl->heap);

0 commit comments

Comments
 (0)