diff options
author | Konstantin Meskhidze <konstantin.meskhidze@huawei.com> | 2023-09-05 17:59:14 +0800 |
---|---|---|
committer | Masahiro Yamada <masahiroy@kernel.org> | 2023-09-06 02:00:02 +0900 |
commit | a3b7039bb2b22fcd2ad20d59c00ed4e606ce3754 (patch) | |
tree | f553fee55288076e03755d53267f17e2429bffc8 /scripts | |
parent | feec5e1f74f5b735c0c5c02ec70673db1334173f (diff) |
kconfig: fix possible buffer overflow
Buffer 'new_argv' is accessed without bound check after accessing with
bound check via 'new_argc' index.
Fixes: e298f3b49def ("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>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/kconfig/preprocess.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/scripts/kconfig/preprocess.c b/scripts/kconfig/preprocess.c index 748da578b418..d1f5bcff4b62 100644 --- a/scripts/kconfig/preprocess.c +++ b/scripts/kconfig/preprocess.c @@ -396,6 +396,9 @@ static char *eval_clause(const char *str, size_t len, int argc, char *argv[]) p++; } + + if (new_argc >= FUNCTION_MAX_ARGS) + pperror("too many function arguments"); new_argv[new_argc++] = prev; /* |