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);
 
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to