2009-08-28 Vladimir Serbinenko <phcoder@gmail.com>
* kern/file.c (grub_file_read): Check offset. * fs/hfs.c (grub_hfs_read_file): Remove unnecessary offset check. * fs/jfs.c (grub_jfs_read_file): Likewise. * fs/ntfs.c (grub_ntfs_read): Likewise. * fs/reiserfs.c (grub_reiserfs_read): Likewise. * fs/minix.c (grub_minix_read_file): Correct offset check. * fs/ufs.c (grub_ufs_read_file): Likewise.
This commit is contained in:
parent
b4f34077c8
commit
6f07b921bc
8 changed files with 21 additions and 24 deletions
|
@ -970,15 +970,6 @@ grub_ntfs_read (grub_file_t file, char *buf, grub_size_t len)
|
|||
if (file->read_hook)
|
||||
mft->attr.save_pos = 1;
|
||||
|
||||
if (file->offset > file->size)
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_FS, "Bad offset");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (file->offset + len > file->size)
|
||||
len = file->size - file->offset;
|
||||
|
||||
read_attr (&mft->attr, buf, file->offset, len, 1, file->read_hook);
|
||||
return (grub_errno) ? 0 : len;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue