summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2010-11-18 21:18:11 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2010-11-18 21:18:11 +0000
commit77eb8f3f8fd7ac63af7818f6b21e71f2c23cde70 (patch)
tree696e787f4888ac7d03aacdb3dde4ac554ba89ded /sys
parentb9e68cb2bdcd0593b6e7fd434b35791c8d03805c (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')
-rw-r--r--sys/ntfs/ntfs_vnops.c6
-rw-r--r--sys/ufs/ext2fs/ext2fs_lookup.c4
2 files changed, 5 insertions, 5 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;
diff --git a/sys/ufs/ext2fs/ext2fs_lookup.c b/sys/ufs/ext2fs/ext2fs_lookup.c
index 9b0ba254d48..0b507359f37 100644
--- a/sys/ufs/ext2fs/ext2fs_lookup.c
+++ b/sys/ufs/ext2fs/ext2fs_lookup.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ext2fs_lookup.c,v 1.26 2010/09/23 18:49:39 oga Exp $ */
+/* $OpenBSD: ext2fs_lookup.c,v 1.27 2010/11/18 21:18:10 miod Exp $ */
/* $NetBSD: ext2fs_lookup.c,v 1.16 2000/08/03 20:29:26 thorpej Exp $ */
/*
@@ -163,7 +163,7 @@ ext2fs_readdir(void *v)
dirbuf = malloc(e2fs_count, M_TEMP, M_WAITOK | M_ZERO);
if (ap->a_ncookies) {
nc = ncookies = e2fs_count / 16;
- cookies = malloc(sizeof (off_t) * ncookies, M_TEMP, M_WAITOK);
+ cookies = malloc(sizeof(*cookies) * ncookies, M_TEMP, M_WAITOK);
*ap->a_cookies = cookies;
}
aiov.iov_base = dirbuf;