From 58693458994b299739003ae17397ddd5458433b6 Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Thu, 16 Aug 2018 10:25:46 +0200 Subject: [PATCH] config: Do not access negative indexes of seen array Signed-off-by: Jakub Jelen (cherry picked from commit 6848c23d8445dca2f76569b5fcdda0babf02e9ea) --- src/config.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/config.c b/src/config.c index 12792afd..49f221e6 100644 --- a/src/config.c +++ b/src/config.c @@ -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;