Skip to content

Commit 0cc1dc2

Browse files
committed
src/x509.c: in x509_aia_append_string(), use heap pointer from supplied *head, and initialize WOLFSSL_STACK.type (fixes "Conditional jump or move depends on uninitialised value(s)" from 08c1397);
wolfssl/wolfcrypt/asn.h: use WC_BITFIELD for extAuthInfoListSz and extAuthInfoListOverflow bitfields, for C89 compat (fixes -Wpedantic from 08c1397).
1 parent c7ed5ff commit 0cc1dc2

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

src/x509.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15002,8 +15002,9 @@ static WOLFSSL_STACK* x509_aia_append_string(WOLFSSL_STACK** head,
1500215002
WOLFSSL_STACK* node;
1500315003
char* url;
1500415004

15005-
node = (WOLFSSL_STACK*)XMALLOC(sizeof(WOLFSSL_STACK) + uriSz + 1, NULL,
15006-
DYNAMIC_TYPE_OPENSSL);
15005+
node = (WOLFSSL_STACK*)XMALLOC(sizeof(WOLFSSL_STACK) + uriSz + 1,
15006+
*head ? (*head)->heap : NULL,
15007+
DYNAMIC_TYPE_OPENSSL);
1500715008
if (node == NULL)
1500815009
return NULL;
1500915010

@@ -15012,9 +15013,11 @@ static WOLFSSL_STACK* x509_aia_append_string(WOLFSSL_STACK** head,
1501215013
XMEMCPY(url, uri, uriSz);
1501315014
url[uriSz] = '\0';
1501415015

15016+
node->heap = *head ? (*head)->heap : NULL;
1501515017
node->data.string = url;
1501615018
node->next = NULL;
1501715019
node->num = 1;
15020+
node->type = STACK_TYPE_STRING;
1501815021

1501915022
if (*head == NULL) {
1502015023
*head = node;

wolfssl/wolfcrypt/asn.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2075,8 +2075,8 @@ struct DecodedCert {
20752075
#endif /* WOLFSSL_DUAL_ALG_CERTS */
20762076

20772077
WOLFSSL_AIA_ENTRY extAuthInfoList[WOLFSSL_MAX_AIA_ENTRIES];
2078-
byte extAuthInfoListSz:7;
2079-
byte extAuthInfoListOverflow:1;
2078+
WC_BITFIELD extAuthInfoListSz:7;
2079+
WC_BITFIELD extAuthInfoListOverflow:1;
20802080
};
20812081

20822082
#if defined(WOLFSSL_SM2) && defined(WOLFSSL_SM3)

0 commit comments

Comments
 (0)