From 7503958e4cd57bcfc2b611594906b56c6645e5f4 Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Wed, 5 Feb 2020 11:02:00 +0000 Subject: [PATCH] zfsboot: vdev_read_pad2 does allocate buffer with wrong size vdev_read_pad2() does read VDEV_PAD_SIZE of data, and will copy size bytes of it, hence, we need buffer of VDEV_PAD_SIZE bytes. Issue introduced in r357497. Reported by: se --- stand/i386/zfsboot/zfsboot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stand/i386/zfsboot/zfsboot.c b/stand/i386/zfsboot/zfsboot.c index e5da51b13b7d..03edb08409c6 100644 --- a/stand/i386/zfsboot/zfsboot.c +++ b/stand/i386/zfsboot/zfsboot.c @@ -324,7 +324,7 @@ vdev_read_pad2(vdev_t *vdev, char *buf, size_t size) if (size > VDEV_PAD_SIZE) size = VDEV_PAD_SIZE; - tmp = malloc(size); + tmp = malloc(VDEV_PAD_SIZE); if (tmp == NULL) return (ENOMEM);