[U-Boot-Users] Patch for ext2fs bug...

Hallo,
on 09/29/2005 John Roberts submits a warning on a bug in "ext2fs.c".
Here is the patch as proposed by John Roberts.
Reinhard
diff -purN u-boot-1.1.4/fs/ext2/ext2fs.c u-boot_20051228/fs/ext2/ext2fs.c --- u-boot-1.1.4/fs/ext2/ext2fs.c 2005-12-16 17:39:27.000000000 +0100 +++ u-boot_20051228/fs/ext2/ext2fs.c 2005-12-28 11:28:40.000000000 +0100 @@ -389,7 +389,7 @@ int ext2fs_read_file int blockcnt; int log2blocksize = LOG2_EXT2_BLOCK_SIZE (node->data); int blocksize = 1 << (log2blocksize + DISK_SECTOR_BITS); - unsigned int filesize = node->inode.size; + unsigned int filesize = __le32_to_cpu(node->inode.size);
/* Adjust len so it we can't read past the end of the file. */ if (len > filesize) {
* Insert missing __le32_to_cpu() for filesize in ext2fs_read_file(). Patch by Reinhard Arlt, 28 Dec 2005.
participants (1)
-
Reinhard Arlt