1
1

config: Do not access negative indexes of seen array

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Этот коммит содержится в:
Jakub Jelen 2018-08-16 10:25:46 +02:00 коммит произвёл Andreas Schneider
родитель 4104d2fb91
Коммит 6848c23d84

Просмотреть файл

@ -383,7 +383,8 @@ static int ssh_config_parse_line(ssh_session session, const char *line,
}
opcode = ssh_config_get_opcode(keyword);
if (*parsing == 1 && opcode != SOC_HOST && opcode != SOC_UNSUPPORTED && opcode != SOC_INCLUDE) {
if (*parsing == 1 && opcode != SOC_HOST && opcode != SOC_INCLUDE &&
opcode > SOC_UNSUPPORTED) { /* Ignore all unknown types here */
if (seen[opcode] != 0) {
SAFE_FREE(x);
return 0;