mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-25 18:59:33 +03:00
FreeBSD: Prevent NULL pointer dereference of resid
spa_config_load() passes NULL into resid when doing zfs_file_read(). This would trip over when vfs.zfs.autoimport_disable=0. Sponsored by: The FreeBSD Foundation Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Allan Jude <allan@klarasystems.com> Signed-off-by: Ka Ho Ng <khng@freebsdfoundation.org> Closes #11149
This commit is contained in:
parent
71ae6a9d23
commit
a4246bce50
@ -158,7 +158,8 @@ zfs_file_read_impl(zfs_file_t *fp, void *buf, size_t count, loff_t *offp,
|
||||
rc = fo_read(fp, &auio, td->td_ucred, FOF_OFFSET, td);
|
||||
if (rc)
|
||||
return (SET_ERROR(rc));
|
||||
*resid = auio.uio_resid;
|
||||
if (resid)
|
||||
*resid = auio.uio_resid;
|
||||
*offp += count - auio.uio_resid;
|
||||
return (SET_ERROR(0));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user