From 77eb8f3f8fd7ac63af7818f6b21e71f2c23cde70 Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Thu, 18 Nov 2010 21:18:11 +0000 Subject: Make sure readdir cookies are actually allocated with the correct size (in case eventually we change their type from u_long to something else), and do not truncate them to 32 bits in the ntfs code. ok tedu@ --- sys/ntfs/ntfs_vnops.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sys/ntfs') diff --git a/sys/ntfs/ntfs_vnops.c b/sys/ntfs/ntfs_vnops.c index 04c975727b7..fd719230bd3 100644 --- a/sys/ntfs/ntfs_vnops.c +++ b/sys/ntfs/ntfs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ntfs_vnops.c,v 1.20 2010/09/10 16:34:09 thib Exp $ */ +/* $OpenBSD: ntfs_vnops.c,v 1.21 2010/11/18 21:18:07 miod Exp $ */ /* $NetBSD: ntfs_vnops.c,v 1.6 2003/04/10 21:57:26 jdolecek Exp $ */ /* @@ -587,12 +587,12 @@ ntfs_readdir(ap) dpStart = (struct dirent *) ((caddr_t)uio->uio_iov->iov_base - (uio->uio_offset - off)); - cookies = malloc(ncookies * sizeof(off_t), M_TEMP, M_WAITOK); + cookies = malloc(ncookies * sizeof(*cookies), M_TEMP, M_WAITOK); for (dp = dpStart, cookiep = cookies, i=0; i < ncookies; dp = (struct dirent *)((caddr_t) dp + dp->d_reclen), i++) { off += dp->d_reclen; - *cookiep++ = (u_int) off; + *cookiep++ = off; } *ap->a_ncookies = ncookies; *ap->a_cookies = cookies; -- cgit v1.2.3