Changes by: antona
Update of /cvsroot/linux-ntfs/ntfsprogs/libntfs
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8158/libntfs
Modified Files:
volume.c
Log Message:
Fix endianness bug (le16 instead of le32 when accessing mft record
bytes_in_use) in volume.c::ntfs_volume_write_flags() and
ntfsfix.c::OLD_ntfs_volume_set_flags(). (Anton)
Index: volume.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/libntfs/volume.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -p -r1.57 -r1.58
--- volume.c 10 Oct 2005 12:55:11 -0000 1.57
+++ volume.c 15 Oct 2005 23:13:50 -0000 1.58
@@ -1509,9 +1509,9 @@ int ntfs_volume_write_flags(ntfs_volume
/* Get a pointer to the value of the attribute. */
c = (VOLUME_INFORMATION*)(le16_to_cpu(a->value_offset) + (char*)a);
/* Sanity checks. */
- if ((char*)c + le32_to_cpu(a->value_length) >
- le16_to_cpu(ctx->mrec->bytes_in_use) +
- (char*)ctx->mrec || le16_to_cpu(a->value_offset) +
+ if ((char*)c + le32_to_cpu(a->value_length) > (char*)ctx->mrec +
+ le32_to_cpu(ctx->mrec->bytes_in_use) ||
+ le16_to_cpu(a->value_offset) +
le32_to_cpu(a->value_length) > le32_to_cpu(a->length)) {
Dputs("Error: Attribute $VOLUME_INFORMATION in $Volume is "
"corrupt!");
|