diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2013-12-02 16:19:09 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2013-12-02 16:19:09 +0000 |
commit | cd0d00732a6c9a484872920b4ef65e6a770c76c4 (patch) | |
tree | 94ac9c4b1043ffe88a7f315843aa9a6678d3d7d8 /sys/ntfs/ntfs_subr.c | |
parent | e5e4e461a2c78cd46646ba8a7f66ea2b1cb958be (diff) |
Avoid truncating 64-bit on disk attribute values to 32-bits. Otherwise an
attribute's data length value wraps at 4GB.
ok krw@
Diffstat (limited to 'sys/ntfs/ntfs_subr.c')
-rw-r--r-- | sys/ntfs/ntfs_subr.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/ntfs/ntfs_subr.c b/sys/ntfs/ntfs_subr.c index 50bd664fc27..178b971b7b8 100644 --- a/sys/ntfs/ntfs_subr.c +++ b/sys/ntfs/ntfs_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ntfs_subr.c,v 1.34 2013/12/02 16:05:07 jsing Exp $ */ +/* $OpenBSD: ntfs_subr.c,v 1.35 2013/12/02 16:19:08 jsing Exp $ */ /* $NetBSD: ntfs_subr.c,v 1.4 2003/04/10 21:37:32 jdolecek Exp $ */ /*- @@ -579,7 +579,7 @@ ntfs_attrtontvattr(struct ntfsmount *ntmp, struct ntvattr **rvapp, memcpy(vap->va_datap, (caddr_t) rap + rap->a_r.a_dataoff, rap->a_r.a_datalen); } - DDPRINTF(", len: %u", vap->va_datalen); + DDPRINTF(", len: %llu", vap->va_datalen); if (error) free(vap, M_NTFSNTVATTR); @@ -1179,7 +1179,7 @@ ntfs_ntreaddir(struct ntfsmount *ntmp, struct fnode *fp, u_int32_t num, goto fail; } cpbl = ntfs_btocn(blsize + ntfs_cntob(1) - 1); - DPRINTF("ntfs_ntreaddir: indexalloc: %u, cpbl: %u\n", + DPRINTF("ntfs_ntreaddir: indexalloc: %llu, cpbl: %u\n", iavap->va_datalen, cpbl); } else { DPRINTF("ntfs_ntreadidir: w/o BitMap and IndexAllocation\n"); @@ -1677,7 +1677,7 @@ ntfs_readattr(struct ntfsmount *ntmp, struct ntnode *ip, u_int32_t attrnum, if ((roff > vap->va_datalen) || (roff + rsize > vap->va_datalen)) { - printf("ntfs_readattr: offset too big: %lld (%lld) > %u\n", + printf("ntfs_readattr: offset too big: %lld (%lld) > %llu\n", roff, roff + rsize, vap->va_datalen); ntfs_ntvattrrele(vap); return (E2BIG); |