From: jsg Date: Tue, 2 Mar 2021 02:56:22 +0000 (+0000) Subject: don't read past the end of an array X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=e8991ca889b87304254741082329b20717dbca3f;p=openbsd don't read past the end of an array ok mvs@ mlarkin@ --- 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 @@ -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);