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
This commit is contained in:
Toomas Soome 2020-02-05 11:02:00 +00:00
parent a1746b2583
commit 7503958e4c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=357569

View File

@ -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);