summaryrefslogtreecommitdiff
path: root/sys/ntfs
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2013-12-02 16:19:09 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2013-12-02 16:19:09 +0000
commitcd0d00732a6c9a484872920b4ef65e6a770c76c4 (patch)
tree94ac9c4b1043ffe88a7f315843aa9a6678d3d7d8 /sys/ntfs
parente5e4e461a2c78cd46646ba8a7f66ea2b1cb958be (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')
-rw-r--r--sys/ntfs/ntfs_subr.c8
-rw-r--r--sys/ntfs/ntfs_subr.h6
2 files changed, 7 insertions, 7 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);
diff --git a/sys/ntfs/ntfs_subr.h b/sys/ntfs/ntfs_subr.h
index 4285ec24720..dc30cad289c 100644
--- a/sys/ntfs/ntfs_subr.h
+++ b/sys/ntfs/ntfs_subr.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ntfs_subr.h,v 1.7 2013/05/30 20:11:06 guenther Exp $ */
+/* $OpenBSD: ntfs_subr.h,v 1.8 2013/12/02 16:19:08 jsing Exp $ */
/* $NetBSD: ntfs_subr.h,v 1.1 2002/12/23 17:38:33 jdolecek Exp $ */
/*-
@@ -46,8 +46,8 @@ struct ntvattr {
u_int32_t va_compression;
u_int32_t va_compressalg;
- u_int32_t va_datalen;
- u_int32_t va_allocated;
+ u_int64_t va_datalen;
+ u_int64_t va_allocated;
cn_t va_vcnstart;
cn_t va_vcnend;
u_int16_t va_index;