From ce93b2e85fc5f6da24e8f4b5edfec634d7230573 Mon Sep 17 00:00:00 2001 From: sogaiu <983021772@users.noreply.github.com> Date: Mon, 25 Dec 2023 11:39:41 +0900 Subject: [PATCH] Address #1342 - check handler arity --- src/core/net.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/net.c b/src/core/net.c index ce8e7d56..e51efa64 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->arity != 1) janet_panicf("handler arity != 1"); janet_sched_accept(stream, fun); }