diff options
author | milo <milo.sshiva@gmail.com> | 2009-07-26 12:33:39 +0200 |
---|---|---|
committer | Andreas Schneider <mail@cynapses.org> | 2009-07-27 20:53:01 +0200 |
commit | 26d1ac325bb7c5ad8463177f8e9da73e787413aa (patch) | |
tree | 57cfd37287010b2a8a10c697843b51e886a39988 /libssh/messages.c | |
parent | 1311d034157fef712a836fca9b6c7800370ccf5a (diff) | |
download | libssh-26d1ac325bb7c5ad8463177f8e9da73e787413aa.tar.gz libssh-26d1ac325bb7c5ad8463177f8e9da73e787413aa.tar.xz libssh-26d1ac325bb7c5ad8463177f8e9da73e787413aa.zip |
Fix potential memory corruption bug
Diffstat (limited to 'libssh/messages.c')
-rw-r--r-- | libssh/messages.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libssh/messages.c b/libssh/messages.c index 284ff72..151cdd7 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; } |