aboutsummaryrefslogtreecommitdiff
path: root/stand/i386/zfsboot
diff options
context:
space:
mode:
authorToomas Soome <tsoome@FreeBSD.org>2020-02-05 11:02:00 +0000
committerToomas Soome <tsoome@FreeBSD.org>2020-02-05 11:02:00 +0000
commit7503958e4cd57bcfc2b611594906b56c6645e5f4 (patch)
tree7fb7df6eab29de1dfeea3f5d9dbe85229c2ac009 /stand/i386/zfsboot
parenta1746b25837c2df4367eed7e8c3665e26e0dc6bb (diff)
downloadsrc-7503958e4cd57bcfc2b611594906b56c6645e5f4.tar.gz
src-7503958e4cd57bcfc2b611594906b56c6645e5f4.zip
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
Notes
Notes: svn path=/head/; revision=357569
Diffstat (limited to 'stand/i386/zfsboot')
-rw-r--r--stand/i386/zfsboot/zfsboot.c2
1 files changed, 1 insertions, 1 deletions
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);