From 101ffd70a7baeb426325c6450d7e34517ae59e9d 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 (cherry picked from commit 574690ae2e8a33a0f618a57e744bfccf74b0960b) --- src/config.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/config.c b/src/config.c index 62279a67..a08e41b8 100644 --- a/src/config.c +++ b/src/config.c @@ -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);