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:39:24 +0100 |
commit | 101ffd70a7baeb426325c6450d7e34517ae59e9d (patch) | |
tree | 8683253b24ef26be1ab0b7b4aa0e72701b25611e | |
parent | 45878b131cbda33ce02545435e01341fa83e5991 (diff) | |
download | libssh-101ffd70a7baeb426325c6450d7e34517ae59e9d.tar.gz libssh-101ffd70a7baeb426325c6450d7e34517ae59e9d.tar.xz libssh-101ffd70a7baeb426325c6450d7e34517ae59e9d.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>
(cherry picked from commit 574690ae2e8a33a0f618a57e744bfccf74b0960b)
-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 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); |