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. --- libhw_cr/host_net.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libhw_cr/host_net.c') diff --git a/libhw_cr/host_net.c b/libhw_cr/host_net.c index 6ed6e46..ba634a6 100644 --- a/libhw_cr/host_net.c +++ b/libhw_cr/host_net.c @@ -19,6 +19,7 @@ #include /* for siginfo_t, struct sigaction, enum sigval, sigaction(), SA_SIGINFO */ #include +#include #include #include #include @@ -283,7 +284,7 @@ static void *hostnet_pthread_writev(void *_args) { struct hostnet_pthread_writev_args *args = _args; size_t count = 0; - struct iovec *iov = alloca(sizeof(struct iovec)*args->iovcnt); + struct iovec *iov = stack_alloc(args->iovcnt, struct iovec); for (int i = 0; i < args->iovcnt; i++) { iov[i] = args->iov[i]; count += args->iov[i].iov_len; -- cgit v1.2.3-2-g168b