Skip to content

Commit f07e379

Browse files
authored
Merge pull request #9456 from anhu/test_inits
Initialize test variables; avoid false warnings.
2 parents 2d9d399 + cf8b729 commit f07e379

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

tests/api.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33815,10 +33815,10 @@ static int test_wolfSSL_d2i_and_i2d_PublicKey(void)
3381533815
EXPECT_DECLS;
3381633816
#if defined(OPENSSL_EXTRA) && !defined(NO_RSA)
3381733817
EVP_PKEY* pkey = NULL;
33818-
const unsigned char* p;
33818+
const unsigned char* p = NULL;
3381933819
unsigned char *der = NULL;
3382033820
unsigned char *tmp = NULL;
33821-
int derLen;
33821+
int derLen = 0;
3382233822

3382333823
p = client_keypub_der_2048;
3382433824
/* Check that key can be successfully decoded. */
@@ -34143,9 +34143,9 @@ static int test_wolfSSL_d2i_OCSP_CERTID(void)
3414334143
{
3414434144
EXPECT_DECLS;
3414534145
#if (defined(OPENSSL_ALL) || defined(WOLFSSL_HAPROXY)) && defined(HAVE_OCSP)
34146-
WOLFSSL_OCSP_CERTID* certIdGood;
34147-
WOLFSSL_OCSP_CERTID* certIdBad;
34148-
const unsigned char* rawCertIdPtr;
34146+
WOLFSSL_OCSP_CERTID* certIdGood = NULL;
34147+
WOLFSSL_OCSP_CERTID* certIdBad = NULL;
34148+
const unsigned char* rawCertIdPtr = NULL;
3414934149

3415034150
const unsigned char rawCertId[] = {
3415134151
0x30, 0x49, 0x30, 0x09, 0x06, 0x05, 0x2b, 0x0e, 0x03, 0x02, 0x1a, 0x05,
@@ -42550,8 +42550,8 @@ static THREAD_RETURN WOLFSSL_THREAD SSL_read_test_client_thread(void* args)
4255042550
char msg[] = "hello wolfssl server!";
4255142551
int len = (int) XSTRLEN(msg);
4255242552
char input[1024];
42553-
int idx;
42554-
int ret, err;
42553+
int idx = 0;
42554+
int ret = 0, err = 0;
4255542555

4255642556
if (!args)
4255742557
WOLFSSL_RETURN_FROM_THREAD(0);

tests/api/test_ossl_sk.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ int test_wolfSSL_sk_push_get_node(void)
5555
WOLFSSL_STACK* stack = NULL;
5656
WOLFSSL_STACK* node1 = NULL;
5757
WOLFSSL_STACK* node2 = NULL;
58-
WOLFSSL_STACK* node;
58+
WOLFSSL_STACK* node = NULL;
5959

6060
ExpectNotNull(node1 = wolfSSL_sk_new_node(HEAP_HINT));
6161
ExpectNotNull(node2 = wolfSSL_sk_new_node(HEAP_HINT));

0 commit comments

Comments
 (0)