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

« back to all changes in this revision

Viewing changes to kern/file.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:
112
112
{
113
113
  grub_ssize_t res;
114
114
 
115
 
  if (file->offset > file->size)
116
 
    {
117
 
      grub_error (GRUB_ERR_OUT_OF_RANGE,
118
 
                  "Attempt to read past the end of file.");
119
 
      return -1;
120
 
    }
121
 
 
122
115
  if (len == 0 || len > file->size - file->offset)
123
116
    len = file->size - file->offset;
124
117