~ilya-yanok/ubuntu/precise/grub2/fix-for-948716

« back to all changes in this revision

Viewing changes to fs/ntfs.c

  • Committer: Bazaar Package Importer
  • Author(s): Robert Millan
  • Date: 2009-07-25 19:00:53 UTC
  • mfrom: (1.6.3 upstream)
  • mto: (17.4.13 sid)
  • mto: This revision was merged to the branch mainline in revision 53.
  • Revision ID: james.westby@ubuntu.com-20090725190053-uv3lm6ya3zxs77ep
ImportĀ upstreamĀ versionĀ 1.96+20090725

Show diffs side-by-side

added added

removed removed

Lines of Context:
543
543
      if (!pa[8])
544
544
        mft->size = u32at (pa, 0x10);
545
545
      else
546
 
        mft->size = u64at (pa, 0x30);
 
546
        mft->size = u32at (pa, 0x30);
547
547
 
548
548
      if ((mft->attr.flags & AF_ALST) == 0)
549
549
        mft->attr.attr_end = 0; /*  Don't jump to attribute list */
970
970
  if (file->read_hook)
971
971
    mft->attr.save_pos = 1;
972
972
 
 
973
  if (file->offset > file->size)
 
974
    {
 
975
      grub_error (GRUB_ERR_BAD_FS, "Bad offset");
 
976
      return -1;
 
977
    }
 
978
 
 
979
  if (file->offset + len > file->size)
 
980
    len = file->size - file->offset;
 
981
 
973
982
  read_attr (&mft->attr, buf, file->offset, len, 1, file->read_hook);
974
983
  return (grub_errno) ? 0 : len;
975
984
}
1081
1090
  return grub_errno;
1082
1091
}
1083
1092
 
1084
 
static struct grub_fs grub_ntfs_fs =
1085
 
  {
1086
 
    .name = "ntfs",
1087
 
    .dir = grub_ntfs_dir,
1088
 
    .open = grub_ntfs_open,
1089
 
    .read = grub_ntfs_read,
1090
 
    .close = grub_ntfs_close,
1091
 
    .label = grub_ntfs_label,
1092
 
    .uuid = grub_ntfs_uuid,
1093
 
#ifdef GRUB_UTIL
1094
 
    .reserved_first_sector = 1,
1095
 
#endif
1096
 
    .next = 0
 
1093
static struct grub_fs grub_ntfs_fs = {
 
1094
  .name = "ntfs",
 
1095
  .dir = grub_ntfs_dir,
 
1096
  .open = grub_ntfs_open,
 
1097
  .read = grub_ntfs_read,
 
1098
  .close = grub_ntfs_close,
 
1099
  .label = grub_ntfs_label,
 
1100
  .uuid = grub_ntfs_uuid,
 
1101
  .next = 0
1097
1102
};
1098
1103
 
1099
1104
GRUB_MOD_INIT (ntfs)