mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-11 10:40:27 +09:00
config: Do not access negative indexes of seen array
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
(cherry picked from commit 6848c23d84)
This commit is contained in:
committed by
Andreas Schneider
parent
0cad2778b4
commit
5869345899
@@ -383,7 +383,8 @@ static int ssh_config_parse_line(ssh_session session, const char *line,
|
|||||||
}
|
}
|
||||||
|
|
||||||
opcode = ssh_config_get_opcode(keyword);
|
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) {
|
if (seen[opcode] != 0) {
|
||||||
SAFE_FREE(x);
|
SAFE_FREE(x);
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user