History

kconfig: fix possible buffer overflow

Buffer 'new_argv' is accessed without bound check after accessing with bound check via 'new_argc' index.

Konstantin Meskhidze committed 3 years ago

Commit a3b70391 parent feec5e11 file · +3 −0Browse files

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/kconfig/preprocess.c+3−0
@@ -396,6 +396,9 @@ static char *eval_clause(const char *str, size_t len, int argc, char *argv[]) · 395 unmodified lines
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 /*