permitted very big mallocs to panic the kernel.
reported by Tim Newsham
ok millert@
-/* $OpenBSD: ufs_vnops.c,v 1.128 2016/06/19 11:54:34 natano Exp $ */
+/* $OpenBSD: ufs_vnops.c,v 1.129 2016/07/14 03:34:28 guenther Exp $ */
/* $NetBSD: ufs_vnops.c,v 1.18 1996/05/11 18:28:04 mycroft Exp $ */
/*
*/
/* read from disk, stopping on a block boundary, max 64kB */
- readcnt = max(count, 64*1024) - entries;
+ readcnt = min(count, 64*1024) - entries;
auio = *uio;
auio.uio_iov = &aiov;