aboutsummaryrefslogtreecommitdiff
path: root/libssh
diff options
context:
space:
mode:
authormilo <milo.sshiva@gmail.com>2009-07-26 12:33:39 +0200
committerAndreas Schneider <mail@cynapses.org>2009-07-27 20:53:01 +0200
commit26d1ac325bb7c5ad8463177f8e9da73e787413aa (patch)
tree57cfd37287010b2a8a10c697843b51e886a39988 /libssh
parent1311d034157fef712a836fca9b6c7800370ccf5a (diff)
downloadlibssh-26d1ac325bb7c5ad8463177f8e9da73e787413aa.tar.gz
libssh-26d1ac325bb7c5ad8463177f8e9da73e787413aa.tar.xz
libssh-26d1ac325bb7c5ad8463177f8e9da73e787413aa.zip
Fix potential memory corruption bug
Diffstat (limited to 'libssh')
-rw-r--r--libssh/messages.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libssh/messages.c b/libssh/messages.c
index 284ff72d..151cdd7f 100644
--- a/libssh/messages.c
+++ b/libssh/messages.c
@@ -164,6 +164,7 @@ static SSH_MESSAGE *handle_userauth_request(SSH_SESSION *session){
goto error;
}
string_free(user);
+ user = NULL;
service_c = string_to_char(service);
if (service_c == NULL) {
@@ -175,7 +176,9 @@ static SSH_MESSAGE *handle_userauth_request(SSH_SESSION *session){
}
string_free(service);
+ service = NULL;
string_free(method);
+ method = NULL;
ssh_log(session, SSH_LOG_PACKET,
"Auth request for service %s, method %s for user '%s'",
@@ -204,7 +207,9 @@ static SSH_MESSAGE *handle_userauth_request(SSH_SESSION *session){
goto error;
}
msg->auth_request.password = string_to_char(pass);
+ string_burn(pass);
string_free(pass);
+ pass = NULL;
if (msg->auth_request.password == NULL) {
goto error;
}