1
1
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:
Lennart Poettering 2022-11-09 15:16:09 +01:00
parent 8cee3283f0
commit 31edf44064

View File

@ -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;