Tests api.c: fixes

NULL dereference.
Uninitialized variable use.
This commit is contained in:
Sean Parkinson
2023-06-26 16:04:24 +10:00
parent 18032cdc40
commit b7332e33c7

View File

@@ -45985,6 +45985,7 @@ static int test_wolfSSL_sk_GENERAL_NAME(void)
for (i = 0; i < sk_GENERAL_NAME_num(sk); i++) { for (i = 0; i < sk_GENERAL_NAME_num(sk); i++) {
ExpectNotNull(gn = sk_GENERAL_NAME_value(sk, i)); ExpectNotNull(gn = sk_GENERAL_NAME_value(sk, i));
if (gn != NULL) {
switch (gn->type) { switch (gn->type) {
case GEN_DNS: case GEN_DNS:
fprintf(stderr, "found type GEN_DNS\n"); fprintf(stderr, "found type GEN_DNS\n");
@@ -45997,6 +45998,7 @@ static int test_wolfSSL_sk_GENERAL_NAME(void)
break; break;
} }
} }
}
X509_free(x509); X509_free(x509);
x509 = NULL; x509 = NULL;
if (j == 0) { if (j == 0) {
@@ -46840,7 +46842,8 @@ static int test_wolfSSL_EVP_Cipher_extra(void)
byte inb[BUFFSZ]; byte inb[BUFFSZ];
byte outb[BUFFSZ+16]; byte outb[BUFFSZ+16];
int outl, inl; int outl = 0;
int inl;
iv = aes128_cbc_iv; iv = aes128_cbc_iv;
ivlen = sizeof(aes128_cbc_iv); ivlen = sizeof(aes128_cbc_iv);
@@ -55715,7 +55718,7 @@ static int test_wolfssl_EVP_aes_gcm_AAD_2_parts(void)
byte out2Part[16]; byte out2Part[16];
byte outTag2Part[16]; byte outTag2Part[16];
byte decryptBuf[16]; byte decryptBuf[16];
int len; int len = 0;
int tlen; int tlen;
EVP_CIPHER_CTX* ctx = NULL; EVP_CIPHER_CTX* ctx = NULL;
@@ -59463,7 +59466,7 @@ static int test_wolfSSL_EC_POINT(void)
#ifndef HAVE_SELFTEST #ifndef HAVE_SELFTEST
EC_POINT *tmp = NULL; EC_POINT *tmp = NULL;
size_t bin_len; size_t bin_len;
unsigned int blen; unsigned int blen = 0;
unsigned char* buf = NULL; unsigned char* buf = NULL;
unsigned char bufInf[1] = { 0x00 }; unsigned char bufInf[1] = { 0x00 };