diff --git a/src/client.c b/src/client.c index 9a68a05e..90f193fd 100644 --- a/src/client.c +++ b/src/client.c @@ -1,4 +1,5 @@ #include +#include #include "trilogy/client.h" #include "trilogy/error.h" @@ -401,7 +402,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) { - memset(conn->socket->opts.password, 0, conn->socket->opts.password_len); + # 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 } }