Tests api.c: fixes

NULL dereference.
Uninitialized variable use.
pull/6542/head
Sean Parkinson 2023-06-26 16:04:24 +10:00
parent 18032cdc40
commit b7332e33c7
1 changed files with 16 additions and 13 deletions

View File

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