Skip to content

Commit f73b835

Browse files
BoardzMasterroxanan1996
authored andcommitted
kconfig: fix possible buffer overflow
BugLink: https://bugs.launchpad.net/bugs/2041702 [ Upstream commit a3b7039 ] Buffer 'new_argv' is accessed without bound check after accessing with bound check via 'new_argc' index. Fixes: e298f3b ("kconfig: add built-in function support") Co-developed-by: Ivanov Mikhail <ivanov.mikhail1@huawei-partners.com> Signed-off-by: Konstantin Meskhidze <konstantin.meskhidze@huawei.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Kamal Mostafa <kamal@canonical.com> Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
1 parent b2bc317 commit f73b835

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

scripts/kconfig/preprocess.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,9 @@ static char *eval_clause(const char *str, size_t len, int argc, char *argv[])
396396

397397
p++;
398398
}
399+
400+
if (new_argc >= FUNCTION_MAX_ARGS)
401+
pperror("too many function arguments");
399402
new_argv[new_argc++] = prev;
400403

401404
/*

0 commit comments

Comments
 (0)