Skip to content

Commit a3b7039

Browse files
BoardzMastermasahir0y
authored andcommitted
kconfig: fix possible buffer overflow
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>
1 parent feec5e1 commit a3b7039

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)