config: Ignore empty lines to avoid OOB array access

Fixes T187

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit 574690ae2e)
This commit is contained in:
Jakub Jelen
2019-10-29 14:49:36 +01:00
committed by Andreas Schneider
parent 45878b131c
commit 101ffd70a7

View File

@@ -394,6 +394,11 @@ ssh_config_parse_line(ssh_session session,
long l;
int64_t ll;
/* Ignore empty lines */
if (line == NULL || *line == '\0') {
return 0;
}
x = s = strdup(line);
if (s == NULL) {
ssh_set_error_oom(session);