WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] [TOOLS] Avoid unaligned accesses in libfs

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [TOOLS] Avoid unaligned accesses in libfsimage FAT16 code
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 16 Aug 2007 07:40:10 -0700
Delivery-date: Thu, 16 Aug 2007 07:40:23 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Tim Deegan <Tim.Deegan@xxxxxxxxxxxxx>
# Date 1186572381 -3600
# Node ID 123ad31e9c3bb98685fea54a2e4d9f4cf57ac44f
# Parent  7953164cebb6dfbbee08d06c91f424b63d87ed71
[TOOLS] Avoid unaligned accesses in libfsimage FAT16 code
Signed-off-by: Kouya Shimura <kouya@xxxxxxxxxxxxxx>
Signed-off-by: KUWAMURA Shin'ya <kuwa@xxxxxxxxxxxxxx>
---
 tools/libfsimage/fat/fsys_fat.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff -r 7953164cebb6 -r 123ad31e9c3b tools/libfsimage/fat/fsys_fat.c
--- a/tools/libfsimage/fat/fsys_fat.c   Tue Aug 07 09:07:29 2007 +0100
+++ b/tools/libfsimage/fat/fsys_fat.c   Wed Aug 08 12:26:21 2007 +0100
@@ -228,15 +228,15 @@ fat_read (fsi_file_t *ffi, char *buf, in
              if (!devread (ffi, sector, 0, FAT_CACHE_SIZE, (char*) FAT_BUF))
                return 0;
            }
-         next_cluster = * (unsigned long *) (FAT_BUF + (cached_pos >> 1));
+         next_cluster = ((__u16 *) (FAT_BUF + (cached_pos >> 1)))[0];
          if (FAT_SUPER->fat_size == 3)
            {
              if (cached_pos & 1)
                next_cluster >>= 4;
              next_cluster &= 0xFFF;
            }
-         else if (FAT_SUPER->fat_size == 4)
-           next_cluster &= 0xFFFF;
+         else if (FAT_SUPER->fat_size > 4)
+           next_cluster |= ((__u16 *) (FAT_BUF + (cached_pos >> 1)))[1] << 16;
          
          if (next_cluster >= FAT_SUPER->clust_eof_marker)
            return ret;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [TOOLS] Avoid unaligned accesses in libfsimage FAT16 code, Xen patchbot-unstable <=