summaryrefslogtreecommitdiff
path: root/usr.sbin/vmd
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2021-03-02 02:56:23 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2021-03-02 02:56:23 +0000
commit2bfa57617cc50f048ba4e6f6258ed917107cc12a (patch)
tree2932f96e0323692eb72429d025a180ede13831d5 /usr.sbin/vmd
parent2c8691491e30fd194a4840c3e31185b6166dda27 (diff)
don't read past the end of an array
ok mvs@ mlarkin@
Diffstat (limited to 'usr.sbin/vmd')
-rw-r--r--usr.sbin/vmd/vmm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/vmd/vmm.c b/usr.sbin/vmd/vmm.c
index 67b7f525004..19964a86f80 100644
--- a/usr.sbin/vmd/vmm.c
+++ b/usr.sbin/vmd/vmm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmm.c,v 1.96 2020/04/30 03:50:53 pd Exp $ */
+/* $OpenBSD: vmm.c,v 1.97 2021/03/02 02:56:22 jsg Exp $ */
/*
* Copyright (c) 2015 Mike Larkin <mlarkin@openbsd.org>
@@ -539,7 +539,7 @@ vmm_dispatch_vm(int fd, short event, void *arg)
IMSG_SIZE_CHECK(&imsg, &vmr);
case IMSG_VMDOP_PAUSE_VM_RESPONSE:
case IMSG_VMDOP_UNPAUSE_VM_RESPONSE:
- for (i = 0; i < sizeof(procs); i++) {
+ for (i = 0; i < nitems(procs); i++) {
if (procs[i].p_id == PROC_PARENT) {
proc_forward_imsg(procs[i].p_ps,
&imsg, PROC_PARENT, -1);