Skip to content

Commit

Permalink
Merge pull request #8319 from philljj/fix_coverity
Browse files Browse the repository at this point in the history
coverity: correct lock message, check fd value.
  • Loading branch information
dgarske authored Dec 26, 2024
2 parents f57f044 + c71392b commit 5c6fdb5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/crl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1102,7 +1102,7 @@ int wolfSSL_X509_STORE_add_crl(WOLFSSL_X509_STORE *store, WOLFSSL_X509_CRL *newc
}

if (crl != newcrl && wc_LockRwLock_Rd(&newcrl->crlLock) != 0) {
WOLFSSL_MSG("wc_LockRwLock_Wr failed");
WOLFSSL_MSG("wc_LockRwLock_Rd failed");
wc_UnLockRwLock(&crl->crlLock);
return BAD_MUTEX_E;
}
Expand Down
3 changes: 3 additions & 0 deletions tests/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -90321,6 +90321,7 @@ static void test_wolfSSL_dtls_plaintext_client(WOLFSSL* ssl)
byte msg[] = "This is a msg for the server";
byte reply[40];

AssertIntGE(fd, 0);
generateDTLSMsg(ch, sizeof(ch), 20, client_hello, 0);
/* Server should ignore this datagram */
AssertIntEQ(send(fd, ch, sizeof(ch), 0), sizeof(ch));
Expand Down Expand Up @@ -90555,6 +90556,7 @@ static void test_wolfSSL_dtls_send_alert(WOLFSSL* ssl)
};

fd = wolfSSL_get_wfd(ssl);
AssertIntGE(fd, 0);
ret = (int)send(fd, alert_msg, sizeof(alert_msg), 0);
AssertIntGT(ret, 0);
}
Expand Down Expand Up @@ -90952,6 +90954,7 @@ static void test_wolfSSL_dtls_send_ch(WOLFSSL* ssl)
};

fd = wolfSSL_get_wfd(ssl);
AssertIntGE(fd, 0);
ret = (int)send(fd, ch_msg, sizeof(ch_msg), 0);
AssertIntGT(ret, 0);
/* consume the HRR otherwise handshake will fail */
Expand Down

0 comments on commit 5c6fdb5

Please sign in to comment.