OSDN Git Service

ntfsck.c: Fix comparison between little-endian and native-endian data.
authorErik Larsson <mechie@users.sourceforge.net>
Wed, 27 Jan 2016 14:21:05 +0000 (15:21 +0100)
committerErik Larsson <mechie@users.sourceforge.net>
Wed, 27 Jan 2016 14:21:05 +0000 (15:21 +0100)
This comparison would yield the wrong result on big-endian systems.

ntfsprogs/ntfsck.c

index fee0dc3..c1087c7 100644 (file)
@@ -608,7 +608,7 @@ static BOOL check_file_record(u8 *buffer, u16 buflen)
 
 
        // We should know all the flags.
-       if (mft_rec->flags>0xf) {
+       if (le16_to_cpu(mft_rec->flags) > 0xf) {
                check_failed("Unknown MFT record flags (0x%x).\n",
                        (unsigned int)le16_to_cpu(mft_rec->flags));
        }