URL:
  <http://savannah.gnu.org/bugs/?52007>

                 Summary: errno not correctly managed in grub_file_open
(kern/file.c)
                 Project: GNU GRUB
            Submitted by: cedric_nokia
            Submitted on: Wed 13 Sep 2017 07:53:36 AM UTC
                Category: Filesystem
                Severity: Major
                Priority: 5 - Normal
              Item Group: Software Error
                  Status: None
                 Privacy: Public
             Assigned to: None
         Originator Name: Cedric
        Originator Email: cedric.pont...@nokia.com
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 
                 Release: 2.02
         Reproducibility: Every Time
         Planned Release: None

    _______________________________________________________

Details:

In function grub_file_open(), grub_errno is used without been initialized
before the call to grub_file_get_device_name().
Unfortunately, the NULL return value of grub_file_get_device_name() can be a
valid result. So it doesn't allow to know if an error has occurred inside it.
And by consequence, we don't know if grub_errno must be tested or not. 

Reproducible:  call a function that set grub_errno to an error  value then
call grub_file_open with a valid file.

Fix: grub_errno should be reset before the call to
grub_file_get_device_name().

BR, Cedric.
-------------------------------------------
grub_file_open (const char *name)
{
  grub_device_t device = 0;
  grub_file_t file = 0, last_file = 0;
  char *device_name;
  const char *file_name;
  grub_file_filter_id_t filter;

  device_name = grub_file_get_device_name (name);
  if (grub_errno)
    goto fail;




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?52007>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/


_______________________________________________
Bug-grub mailing list
Bug-grub@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-grub

Reply via email to