Skip to content

Commit

Permalink
replace memset_s with explicit_bzero
Browse files Browse the repository at this point in the history
if memset_s is not available use explict_bzero instead.
  • Loading branch information
dhruvCW committed Aug 15, 2023
1 parent 7139758 commit fc9dd87
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,11 @@ int trilogy_auth_switch_send(trilogy_conn_t *conn, const trilogy_handshake_t *ha
void trilogy_auth_clear_password(trilogy_conn_t *conn)
{
if (conn->socket->opts.password) {
# ifdef __STDC_WANT_LIB_EXT1__
memset_s(conn->socket->opts.password, conn->socket->opts.password_len, 0, conn->socket->opts.password_len);
#else
explicit_bzero(conn->socket->opts.password, conn->socket->opts.password_len);
#endif
}
}

Expand Down

0 comments on commit fc9dd87

Please sign in to comment.