mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-19 05:39:17 +02:00
Initial error handling for max args
Would like something more sophisticated than this, but this is a first-cut of code to prevent segfaulting due to too many arguments being received.
This commit is contained in:
parent
da7c6e0cf4
commit
31caeff533
1 changed files with 6 additions and 0 deletions
|
@ -6258,6 +6258,12 @@ void Cyc_make_shared_object(void *data, object k, object obj)
|
|||
void dispatch(void *data, int argc, function_type func, object clo, object cont,
|
||||
object args)
|
||||
{
|
||||
if (argc > 100000) {
|
||||
char buf[128];
|
||||
snprintf(buf, 127, "Too many arguments %d", argc);
|
||||
Cyc_rt_raise_msg(data, buf);
|
||||
}
|
||||
|
||||
object b[argc + 1]; // OK to do this? Is this portable?
|
||||
int i;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue