[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] messages: use predefined macro for clearing sensitive data


Signed-off-by: Luka Perkov <luka.perkov@xxxxxxxxxx>
---
 src/messages.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/messages.c b/src/messages.c
index 4246c63..e7bf39f 100644
--- a/src/messages.c
+++ b/src/messages.c
@@ -508,8 +508,7 @@ void ssh_message_free(ssh_message msg){
     case SSH_REQUEST_AUTH:
       SAFE_FREE(msg->auth_request.username);
       if (msg->auth_request.password) {
-        memset(msg->auth_request.password, 0,
-            strlen(msg->auth_request.password));
+        BURN_STRING(msg->auth_request.password);
         SAFE_FREE(msg->auth_request.password);
       }
       ssh_key_free(msg->auth_request.pubkey);
-- 
1.9.1


Archive administrator: postmaster@lists.cynapses.org