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:
parent
a1746b2583
commit
7503958e4c
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user