From db9a58f48c6eae16fbfcd89d59b09e123dbed54f Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Tue, 15 Apr 2025 15:58:31 -0600 Subject: libmisc: Add alloc.h to help detect wrong alloc sizes Lo and behold, there was a mistake in chan.c. --- lib9p/srv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib9p/srv.c') diff --git a/lib9p/srv.c b/lib9p/srv.c index 5c50130..a681952 100644 --- a/lib9p/srv.c +++ b/lib9p/srv.c @@ -4,7 +4,6 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ -#include #include /* for PRI* */ #include /* for SSIZE_MAX, not set by newlib */ #include /* for size_t */ @@ -17,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -739,7 +739,7 @@ static void handle_Tversion(struct srv_req *ctx, if (map_len(&ctx->parent_sess->reqs)) { /* Flush all in-progress requests, and wait for them * to finish. */ - struct cr_select_arg *list = alloca(sizeof(struct cr_select_arg) * map_len(&ctx->parent_sess->reqs)); + struct cr_select_arg *list = stack_alloc(map_len(&ctx->parent_sess->reqs), struct cr_select_arg); while (map_len(&ctx->parent_sess->reqs)) { size_t i = 0; bool flushed; -- cgit v1.2.3-2-g168b