From fc9dd87553cd56a50c3414776b342cec4aa6cf12 Mon Sep 17 00:00:00 2001 From: Dhruv Paranjape Date: Tue, 15 Aug 2023 15:23:22 +0200 Subject: [PATCH] replace memset_s with explicit_bzero if memset_s is not available use explict_bzero instead. --- src/client.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/client.c b/src/client.c index 23d44803..bbeab07c 100644 --- a/src/client.c +++ b/src/client.c @@ -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 } }