From 42d1efe4f9d36a512383e0979ea2fa7a6d9801c7 Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Tue, 9 Nov 2021 09:33:41 +0100 Subject: [PATCH] bind_config: Ignore empty lines This also avoids buffer overflow with empty lines. Signed-off-by: Jakub Jelen Reviewed-by: Andreas Schneider --- src/bind_config.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/bind_config.c b/src/bind_config.c index 020dff62..4c891c95 100644 --- a/src/bind_config.c +++ b/src/bind_config.c @@ -301,7 +301,12 @@ ssh_bind_config_parse_line(ssh_bind bind, return -1; } - if ((line == NULL) || (parser_flags == NULL)) { + /* Ignore empty lines */ + if (line == NULL || *line == '\0') { + return 0; + } + + if (parser_flags == NULL) { ssh_set_error_invalid(bind); return -1; }