[syslinux:master] NTFS: Incorrect parsing of file runs

syslinux-bot for Andy Alex andy at r-tt.com
Thu Mar 13 20:06:02 PDT 2014


Commit-ID:  e5c89c14117379a7076bcdb002010e8f1363845a
Gitweb:     http://www.syslinux.org/commit/e5c89c14117379a7076bcdb002010e8f1363845a
Author:     Andy Alex <andy at r-tt.com>
AuthorDate: Thu, 20 Feb 2014 19:49:58 +0400
Committer:  H. Peter Anvin <hpa at zytor.com>
CommitDate: Thu, 13 Mar 2014 20:02:15 -0700

NTFS: Incorrect parsing of file runs

Length of some extents of NTFS files is parsed in wrong way.

Signed-off-by: Andy Alex <andy at r-tt.com>
Signed-off-by: H. Peter Anvin <hpa at zytor.com>

---
 core/fs/ntfs/ntfs.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/core/fs/ntfs/ntfs.c b/core/fs/ntfs/ntfs.c
index 6a983de..23ef1e0 100644
--- a/core/fs/ntfs/ntfs.c
+++ b/core/fs/ntfs/ntfs.c
@@ -352,7 +352,6 @@ static int parse_data_run(const void *stream, uint32_t *offset,
     uint8_t *byte;
     int byte_shift = 8;
     int mask;
-    uint8_t val;
     int64_t res;
 
     (void)attr_len;
@@ -381,11 +380,8 @@ static int parse_data_run(const void *stream, uint32_t *offset,
     count = v;
 
     res = 0LL;
-    while (count--) {
-        val = *byte--;
-        mask = val >> (byte_shift - 1);
-        res = (res << byte_shift) | ((val + mask) ^ mask);
-    }
+    while (count--)
+	res = (res << bytes_shift) | *byte--;
 
     chunk->len = res;   /* get length data */
 


More information about the Syslinux-commits mailing list