fix whitespace in wolfssl/wolfcrypt/settings.h;

fix bugprone-macro-parentheses in wolfssl/ssl.h;

fix pointerOutOfBounds and declaration-after-statement in src/internal.c DtlsMsgAssembleCompleteMessage().
This commit is contained in:
Daniel Pouzzner
2022-09-09 15:25:06 -05:00
parent 3bd91c6ab8
commit 0603031362
3 changed files with 11 additions and 9 deletions

View File

@ -8326,6 +8326,8 @@ static DtlsFragBucket* DtlsMsgCombineFragBuckets(DtlsMsg* msg,
static void DtlsMsgAssembleCompleteMessage(DtlsMsg* msg)
{
DtlsHandShakeHeader* dtls;
/* We have received all necessary fragments. Reconstruct the header. */
if (msg->fragBucketListCount != 1 || msg->fragBucketList->m.m.offset != 0 ||
msg->fragBucketList->m.m.sz != msg->sz) {
@ -8341,9 +8343,9 @@ static void DtlsMsgAssembleCompleteMessage(DtlsMsg* msg)
/* frag->padding makes sure we can fit the entire DTLS handshake header
* before frag->buf */
DtlsHandShakeHeader* dtls =
(DtlsHandShakeHeader*)(msg->fragBucketList->buf -
DTLS_HANDSHAKE_HEADER_SZ);
dtls = (DtlsHandShakeHeader*)(void *)((char *)msg->fragBucketList
+ OFFSETOF(DtlsFragBucket,buf)
- DTLS_HANDSHAKE_HEADER_SZ);
msg->fragBucketList = NULL;
msg->fragBucketListCount = 0;

View File

@ -4578,7 +4578,7 @@ WOLFSSL_API void wolfSSL_sk_X509_INFO_pop_free(WOLF_STACK_OF(WOLFSSL_X509_INFO)*
WOLFSSL_API void wolfSSL_sk_X509_INFO_free(WOLF_STACK_OF(WOLFSSL_X509_INFO)*);
#define WOLF_SK_COMPARE_CB(type, arg) \
int (*arg) (const type* const* a, const type* const* b)
int (*(arg)) (const type* const* a, const type* const* b)
typedef unsigned long (*wolf_sk_hash_cb) (const void *v);
WOLFSSL_API WOLF_STACK_OF(WOLFSSL_X509_NAME)* wolfSSL_sk_X509_NAME_new(
WOLF_SK_COMPARE_CB(WOLFSSL_X509_NAME, cb));