[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #52007] errno not correctly managed in grub_file_open (kern/file.c)
From: |
cedric |
Subject: |
[bug #52007] errno not correctly managed in grub_file_open (kern/file.c) |
Date: |
Wed, 13 Sep 2017 03:53:38 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:55.0) Gecko/20100101 Firefox/55.0 |
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: address@hidden
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/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [bug #52007] errno not correctly managed in grub_file_open (kern/file.c),
cedric <=