summaryrefslogtreecommitdiff
path: root/regress/sys/kern
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2023-07-09 09:33:31 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2023-07-09 09:33:31 +0000
commitf1a8be94d5e00d1471f6a7104aecaa448fcde7f1 (patch)
treed86832b3ff6f3817e900d07864ed2742770f84f3 /regress/sys/kern
parent4537a58e2d07f6ce71453de7294bd22a00532328 (diff)
Allocate enough memory to pervent SIGSEGV or SIGABRT due to write
after free. There was confusion between size of struct and size of pointer.
Diffstat (limited to 'regress/sys/kern')
-rw-r--r--regress/sys/kern/unixsockets/unsendrecvthr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/regress/sys/kern/unixsockets/unsendrecvthr.c b/regress/sys/kern/unixsockets/unsendrecvthr.c
index 9a4f3628755..e224937129a 100644
--- a/regress/sys/kern/unixsockets/unsendrecvthr.c
+++ b/regress/sys/kern/unixsockets/unsendrecvthr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: unsendrecvthr.c,v 1.1 2021/12/09 23:37:18 mvs Exp $ */
+/* $OpenBSD: unsendrecvthr.c,v 1.2 2023/07/09 09:33:30 bluhm Exp $ */
/*
* Copyright (c) 2021 Vitaliy Makkoveev <mvs@openbsd.org>
@@ -180,7 +180,7 @@ main(int argc, char *argv[])
err(1, "socketpair");
for (i = 0; i < 2; ++i) {
- if (!(rx_data[i] = calloc(ncpu, sizeof(*rx_data))))
+ if (!(rx_data[i] = calloc(ncpu, sizeof(struct rx_data))))
err(1, "calloc");
for (j = 0; j < ncpu; ++j)
@@ -194,7 +194,7 @@ main(int argc, char *argv[])
}
for (i = 0; i < 2; ++i) {
- if (!(tx_args[i] = calloc(ncpu, sizeof(*tx_args))))
+ if (!(tx_args[i] = calloc(ncpu, sizeof(struct thr_tx_arg))))
err(1, "calloc");
for (j = 0; j < ncpu; ++j) {