diff options
author | Jakub Jelen <jjelen@redhat.com> | 2019-10-29 14:49:36 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2019-12-09 16:08:03 +0100 |
commit | 574690ae2e8a33a0f618a57e744bfccf74b0960b (patch) | |
tree | 242d5549e88174b4693e970035db4cd8ca47f6b6 /src/config.c | |
parent | c7cacf986ff47b32f61ebd4a8cbbab19afbfb5d0 (diff) | |
download | libssh-574690ae2e8a33a0f618a57e744bfccf74b0960b.tar.gz libssh-574690ae2e8a33a0f618a57e744bfccf74b0960b.tar.xz libssh-574690ae2e8a33a0f618a57e744bfccf74b0960b.zip |
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>
Diffstat (limited to 'src/config.c')
-rw-r--r-- | src/config.c | 5 |
1 files changed, 5 insertions, 0 deletions
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); |