From 574690ae2e8a33a0f618a57e744bfccf74b0960b Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Tue, 29 Oct 2019 14:49:36 +0100 Subject: [PATCH] config: Ignore empty lines to avoid OOB array access Fixes T187 Signed-off-by: Jakub Jelen Reviewed-by: Andreas Schneider --- src/config.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/config.c b/src/config.c index 2ba21a20..161985ef 100644 --- a/src/config.c +++ b/src/config.c @@ -521,6 +521,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);