mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-25 08:39:28 +00:00
2007-05-18 Jeroen Dekkers <jeroen@dekkers.cx>
* kern/disk.c (grub_disk_read): Check return value of grub_realloc().
This commit is contained in:
1 parent
260ba823e6
commit
7262eca1e3
2 files changed
+12
-1
No files matched your search
@@ -1,3 +1,8 @@
|
|||||||
|
2007-05-18 Jeroen Dekkers <jeroen@dekkers.cx>
|
||||||
|
|
||||||
|
* kern/disk.c (grub_disk_read): Check return value of
|
||||||
|
grub_realloc().
|
||||||
|
|
||||||
2007-05-18 Jeroen Dekkers <jeroen@dekkers.cx>
|
2007-05-18 Jeroen Dekkers <jeroen@dekkers.cx>
|
||||||
|
|
||||||
* util/getroot.c (grub_util_get_grub_dev): Support partitionable
|
* util/getroot.c (grub_util_get_grub_dev): Support partitionable
|
||||||
|
|||||||
+7
-1
@@ -409,13 +409,19 @@ grub_disk_read (grub_disk_t disk, grub_disk_addr_t sector,
|
|||||||
{
|
{
|
||||||
/* Uggh... Failed. Instead, just read necessary data. */
|
/* Uggh... Failed. Instead, just read necessary data. */
|
||||||
unsigned num;
|
unsigned num;
|
||||||
|
char *p;
|
||||||
|
|
||||||
grub_errno = GRUB_ERR_NONE;
|
grub_errno = GRUB_ERR_NONE;
|
||||||
|
|
||||||
num = ((size + GRUB_DISK_SECTOR_SIZE - 1)
|
num = ((size + GRUB_DISK_SECTOR_SIZE - 1)
|
||||||
>> GRUB_DISK_SECTOR_BITS);
|
>> GRUB_DISK_SECTOR_BITS);
|
||||||
|
|
||||||
tmp_buf = grub_realloc (tmp_buf, num << GRUB_DISK_SECTOR_BITS);
|
p = grub_realloc (tmp_buf, num << GRUB_DISK_SECTOR_BITS);
|
||||||
|
if (!p)
|
||||||
|
goto finish;
|
||||||
|
|
||||||
|
tmp_buf = p;
|
||||||
|
|
||||||
if ((disk->dev->read) (disk, sector, num, tmp_buf))
|
if ((disk->dev->read) (disk, sector, num, tmp_buf))
|
||||||
{
|
{
|
||||||
grub_error_push ();
|
grub_error_push ();
|
||||||
|
|||||||
Reference in new issue
Block a user