mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-21 18:03:41 +03:00
acpi-fpdt: make sure length/type fields are available in acpi_fpdt_header
some extra safety: make sure the two fields we care about are actually properly present before the buffer is over.
This commit is contained in:
parent
8cee3283f0
commit
31edf44064
@ -89,7 +89,7 @@ int acpi_get_boot_usec(usec_t *ret_loader_start, usec_t *ret_loader_exit) {
|
||||
|
||||
/* find Firmware Basic Boot Performance Pointer Record */
|
||||
for (rec = (struct acpi_fpdt_header *)(buf + sizeof(struct acpi_table_header));
|
||||
(char *)rec < buf + l;
|
||||
(char *)rec + offsetof(struct acpi_fpdt_header, revision) <= buf + l;
|
||||
rec = (struct acpi_fpdt_header *)((char *)rec + rec->length)) {
|
||||
if (rec->length <= 0)
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user