1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-30 13:01:23 +03:00

bind_config: Ignore empty lines

This also avoids buffer overflow with empty lines.

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Jakub Jelen
2021-11-09 09:33:41 +01:00
parent 0aa3b4ee81
commit 42d1efe4f9

View File

@@ -301,7 +301,12 @@ ssh_bind_config_parse_line(ssh_bind bind,
return -1; 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); ssh_set_error_invalid(bind);
return -1; return -1;
} }