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

Andy Alex andy at r-tt.com
Thu Feb 20 07:49:58 PST 2014


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

Signed-off-by: Andy Alex <andy at r-tt.com>
---
diff -uprN syslinux-6.02.orig/core/fs/ntfs/ntfs.c 
syslinux-6.02/core/fs/ntfs/ntfs.c
--- syslinux-6.02.orig/core/fs/ntfs/ntfs.c    2013-10-13 
21:59:03.000000000 +0400
+++ syslinux-6.02/core/fs/ntfs/ntfs.c    2014-02-20 12:20:26.000000000 +0400
@@ -352,7 +352,6 @@ static int parse_data_run(const void *st
      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 *st
      count = v;

      res = 0LL;
-    while (count--) {
-        val = *byte--;
-        mask = val >> (byte_shift - 1);
-        res = (res << byte_shift) | ((val + mask) ^ mask);
-    }
+    while (count--)
+        res = (res << byte_shift) | *byte--;

      chunk->len = res;   /* get length data */




More information about the Syslinux mailing list