From 2a2fdc168c1ed2148ccd8ffc76497e39cb800082 Mon Sep 17 00:00:00 2001
From: Matt Johnston <matt@ucc.asn.au>
Date: Sun, 8 Aug 2004 16:44:11 +0000
Subject: [PATCH] burn the buffer a bit earlier

--HG--
extra : convert_revision : 1f069f6a8a2ecee6f2e22b51751b73982606accb
---
 svr-authpasswd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/svr-authpasswd.c b/svr-authpasswd.c
index cc9e838b..72495536 100644
--- a/svr-authpasswd.c
+++ b/svr-authpasswd.c
@@ -87,6 +87,8 @@ void svr_auth_password() {
 
 	/* the first bytes of passwdcrypt are the salt */
 	testcrypt = crypt((char*)password, passwdcrypt);
+	m_burn(password, passwordlen);
+	m_free(password);
 
 	if (strcmp(testcrypt, passwdcrypt) == 0) {
 		/* successful authentication */
@@ -101,8 +103,6 @@ void svr_auth_password() {
 		send_msg_userauth_failure(0, 1);
 	}
 
-	m_burn(password, passwordlen);
-	m_free(password);
 }
 
 #endif /* DROPBEAR_PASSWORD_AUTH */
-- 
GitLab