Added check for total arguments size for variadic functions.

This commit is contained in:
acqn
2023-09-18 16:44:04 +08:00
parent 12193790e5
commit 51e304f10f
2 changed files with 17 additions and 0 deletions

View File

@@ -1035,6 +1035,10 @@ static void FunctionCall (ExprDesc* Expr)
/* Parse the argument list and pass them to the called function */
ArgSize = FunctionArgList (Func, IsFastcall, Expr);
if (ArgSize > 0xFF && (Func->Flags & FD_VARIADIC) != 0) {
Error ("Total size of all arguments passed to a variadic function cannot exceed 255 bytes");
}
/* We need the closing paren here */
ConsumeRParen ();