X Tutup
Skip to content

Commit f576cd2

Browse files
Conscript89keszybz
authored andcommitted
acpi-fpdt: break on zero or negative length read
https://bugzilla.redhat.com/show_bug.cgi?id=1027478
1 parent fd201fd commit f576cd2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/shared/acpi-fpdt.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ int acpi_get_boot_usec(usec_t *loader_start, usec_t *loader_exit) {
109109
for (rec = (struct acpi_fpdt_header *)(buf + sizeof(struct acpi_table_header));
110110
(char *)rec < buf + l;
111111
rec = (struct acpi_fpdt_header *)((char *)rec + rec->length)) {
112+
if (rec->length <= 0)
113+
break;
112114
if (rec->type != ACPI_FPDT_TYPE_BOOT)
113115
continue;
114116
if (rec->length != sizeof(struct acpi_fpdt_header))

0 commit comments

Comments
 (0)
X Tutup