diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2010-11-18 21:18:11 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2010-11-18 21:18:11 +0000 |
commit | 77eb8f3f8fd7ac63af7818f6b21e71f2c23cde70 (patch) | |
tree | 696e787f4888ac7d03aacdb3dde4ac554ba89ded /sys/ntfs | |
parent | b9e68cb2bdcd0593b6e7fd434b35791c8d03805c (diff) |
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@
Diffstat (limited to 'sys/ntfs')
-rw-r--r-- | sys/ntfs/ntfs_vnops.c | 6 |
1 files changed, 3 insertions, 3 deletions
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; |