mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-29 01:03:57 +03:00
Fix potential memory corruption bug
This commit is contained in:
@@ -164,6 +164,7 @@ static SSH_MESSAGE *handle_userauth_request(SSH_SESSION *session){
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
string_free(user);
|
string_free(user);
|
||||||
|
user = NULL;
|
||||||
|
|
||||||
service_c = string_to_char(service);
|
service_c = string_to_char(service);
|
||||||
if (service_c == NULL) {
|
if (service_c == NULL) {
|
||||||
@@ -175,7 +176,9 @@ static SSH_MESSAGE *handle_userauth_request(SSH_SESSION *session){
|
|||||||
}
|
}
|
||||||
|
|
||||||
string_free(service);
|
string_free(service);
|
||||||
|
service = NULL;
|
||||||
string_free(method);
|
string_free(method);
|
||||||
|
method = NULL;
|
||||||
|
|
||||||
ssh_log(session, SSH_LOG_PACKET,
|
ssh_log(session, SSH_LOG_PACKET,
|
||||||
"Auth request for service %s, method %s for user '%s'",
|
"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;
|
goto error;
|
||||||
}
|
}
|
||||||
msg->auth_request.password = string_to_char(pass);
|
msg->auth_request.password = string_to_char(pass);
|
||||||
|
string_burn(pass);
|
||||||
string_free(pass);
|
string_free(pass);
|
||||||
|
pass = NULL;
|
||||||
if (msg->auth_request.password == NULL) {
|
if (msg->auth_request.password == NULL) {
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user