Date: Wed, 5 Feb 2020 11:02:01 +0000 (UTC) From: Toomas Soome <tsoome@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357569 - head/stand/i386/zfsboot Message-ID: <202002051102.015B21wp025814@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: tsoome Date: Wed Feb 5 11:02:00 2020 New Revision: 357569 URL: https://svnweb.freebsd.org/changeset/base/357569 Log: 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 Modified: head/stand/i386/zfsboot/zfsboot.c Modified: head/stand/i386/zfsboot/zfsboot.c ============================================================================== --- head/stand/i386/zfsboot/zfsboot.c Wed Feb 5 08:55:19 2020 (r357568) +++ head/stand/i386/zfsboot/zfsboot.c Wed Feb 5 11:02:00 2020 (r357569) @@ -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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202002051102.015B21wp025814>