Skip to content

Commit 145ca4a

Browse files
authored
Merge pull request #6542 from SparkiDev/api_fixes_1
Tests api.c: fixes
2 parents 23c60b7 + b7332e3 commit 145ca4a

1 file changed

Lines changed: 16 additions & 13 deletions

File tree

tests/api.c

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39700,16 +39700,18 @@ static int test_wolfSSL_sk_GENERAL_NAME(void)
3970039700
for (i = 0; i < sk_GENERAL_NAME_num(sk); i++) {
3970139701
ExpectNotNull(gn = sk_GENERAL_NAME_value(sk, i));
3970239702

39703-
switch (gn->type) {
39704-
case GEN_DNS:
39705-
fprintf(stderr, "found type GEN_DNS\n");
39706-
break;
39707-
case GEN_EMAIL:
39708-
fprintf(stderr, "found type GEN_EMAIL\n");
39709-
break;
39710-
case GEN_URI:
39711-
fprintf(stderr, "found type GEN_URI\n");
39712-
break;
39703+
if (gn != NULL) {
39704+
switch (gn->type) {
39705+
case GEN_DNS:
39706+
fprintf(stderr, "found type GEN_DNS\n");
39707+
break;
39708+
case GEN_EMAIL:
39709+
fprintf(stderr, "found type GEN_EMAIL\n");
39710+
break;
39711+
case GEN_URI:
39712+
fprintf(stderr, "found type GEN_URI\n");
39713+
break;
39714+
}
3971339715
}
3971439716
}
3971539717
X509_free(x509);
@@ -40555,7 +40557,8 @@ static int test_wolfSSL_EVP_Cipher_extra(void)
4055540557

4055640558
byte inb[BUFFSZ];
4055740559
byte outb[BUFFSZ+16];
40558-
int outl, inl;
40560+
int outl = 0;
40561+
int inl;
4055940562

4056040563
iv = aes128_cbc_iv;
4056140564
ivlen = sizeof(aes128_cbc_iv);
@@ -49424,7 +49427,7 @@ static int test_wolfssl_EVP_aes_gcm_AAD_2_parts(void)
4942449427
byte out2Part[16];
4942549428
byte outTag2Part[16];
4942649429
byte decryptBuf[16];
49427-
int len;
49430+
int len = 0;
4942849431
int tlen;
4942949432
EVP_CIPHER_CTX* ctx = NULL;
4943049433

@@ -53173,7 +53176,7 @@ static int test_wolfSSL_EC_POINT(void)
5317353176
#ifndef HAVE_SELFTEST
5317453177
EC_POINT *tmp = NULL;
5317553178
size_t bin_len;
53176-
unsigned int blen;
53179+
unsigned int blen = 0;
5317753180
unsigned char* buf = NULL;
5317853181
unsigned char bufInf[1] = { 0x00 };
5317953182

0 commit comments

Comments
 (0)