* grub-core/commands/lsacpi.c (disp_acpi_xsdt_table): Fix loop condition

to avoid infinite loop.
	(disp_acpi_rsdt_table): Likewise.
This commit is contained in:
Grégoire Sutre 2012-02-24 11:48:07 +01:00 committed by Vladimir 'phcoder' Serbinenko
parent 274416e82f
commit 697f18b067
2 changed files with 8 additions and 2 deletions

View file

@ -1,3 +1,9 @@
2012-02-24 Grégoire Sutre <gregoire.sutre@gmail.com>
* grub-core/commands/lsacpi.c (disp_acpi_xsdt_table): Fix loop condition
to avoid infinite loop.
(disp_acpi_rsdt_table): Likewise.
2012-02-24 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/font/font.c (grub_font_load): Add support for default

View file

@ -132,7 +132,7 @@ disp_acpi_xsdt_table (struct grub_acpi_table_header *t)
disp_acpi_table (t);
len = t->length - sizeof (*t);
desc = (grub_uint64_t *) (t + 1);
for (; len > 0; desc++, len -= sizeof (*desc))
for (; len >= sizeof (*desc); desc++, len -= sizeof (*desc))
{
#if GRUB_CPU_SIZEOF_VOID_P == 4
if (*desc >= (1ULL << 32))
@ -163,7 +163,7 @@ disp_acpi_rsdt_table (struct grub_acpi_table_header *t)
disp_acpi_table (t);
len = t->length - sizeof (*t);
desc = (grub_uint32_t *) (t + 1);
for (; len > 0; desc++, len -= sizeof (*desc))
for (; len >= sizeof (*desc); desc++, len -= sizeof (*desc))
{
t = (struct grub_acpi_table_header *) (grub_addr_t) *desc;