Skip to content

Commit 2196652

Browse files
committed
tests/api.c: fix -Wnull-dereferences in wolfSSL_UseSecureRenegotiation().
1 parent 49c3114 commit 2196652

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

tests/api.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10296,11 +10296,15 @@ static int test_wolfSSL_clear_secure_renegotiation(void)
1029610296

1029710297
ExpectIntEQ(WOLFSSL_SUCCESS, wolfSSL_UseSecureRenegotiation(ssl));
1029810298
ExpectNotNull(ssl->secure_renegotiation);
10299-
if (ssl->secure_renegotiation != NULL)
10300-
ssl->secure_renegotiation->enabled = 1;
10299+
if (EXPECT_SUCCESS()) {
10300+
if (ssl->secure_renegotiation != NULL)
10301+
ssl->secure_renegotiation->enabled = 1;
10302+
}
1030110303

1030210304
ExpectIntEQ(WOLFSSL_SUCCESS, wolfSSL_clear(ssl));
10303-
support = wolfSSL_SSL_get_secure_renegotiation_support(ssl);
10305+
if (EXPECT_SUCCESS()) {
10306+
support = wolfSSL_SSL_get_secure_renegotiation_support(ssl);
10307+
}
1030410308
ExpectNull(ssl->secure_renegotiation);
1030510309
ExpectIntEQ(WOLFSSL_FAILURE, support);
1030610310

0 commit comments

Comments
 (0)