1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-12-12 15:41:16 +03:00

Fix regression in IPv6 addresses in hostname parsing

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Jakub Jelen
2023-12-22 10:32:40 +01:00
parent b3de3a3335
commit 4f997aee7c
4 changed files with 23 additions and 18 deletions

View File

@@ -634,17 +634,11 @@ int ssh_options_set(ssh_session session, enum ssh_options_e type,
ssh_set_error_invalid(session);
return -1;
} else {
char *username = NULL, *hostname = NULL, *port = NULL;
rc = ssh_config_parse_uri(value, &username, &hostname, &port);
char *username = NULL, *hostname = NULL;
rc = ssh_config_parse_uri(value, &username, &hostname, NULL, true);
if (rc != SSH_OK) {
return -1;
}
if (port != NULL) {
SAFE_FREE(username);
SAFE_FREE(hostname);
SAFE_FREE(port);
return -1;
}
if (username != NULL) {
SAFE_FREE(session->opts.username);
session->opts.username = username;