From be11a2a1adde8565b3e29dcd7386a4547a6041d8 Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Sun, 31 Dec 2023 18:36:22 -0600 Subject: [PATCH] Fix #1342 --- src/core/net.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/net.c b/src/core/net.c index ce8e7d56..2e71718a 100644 --- a/src/core/net.c +++ b/src/core/net.c @@ -821,6 +821,7 @@ JANET_CORE_FN(cfun_stream_accept_loop, JanetStream *stream = janet_getabstract(argv, 0, &janet_stream_type); janet_stream_flags(stream, JANET_STREAM_ACCEPTABLE | JANET_STREAM_SOCKET); JanetFunction *fun = janet_getfunction(argv, 1); + if (fun->def->min_arity < 1) janet_panic("handler function must take at least 1 argument"); janet_sched_accept(stream, fun); }