[coreboot-gerrit] Patch set updated for coreboot: util/intelmetool: Fix segfault on edge cases
Huan Truong (htruong@tnhh.net)
gerrit at coreboot.org
Sun Mar 5 17:16:04 CET 2017
Huan Truong (htruong at tnhh.net) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/18573
-gerrit
commit 49c21ab9c5947338147de096682489378ea6d5ba
Author: Huan Truong <htruong at tnhh.net>
Date: Sun Mar 5 02:24:51 2017 -0600
util/intelmetool: Fix segfault on edge cases
The intel ME checker tool would segfault if it reaches the end of
the loop without having the dev pointer set. This happens when
it gets to the end of the previous loop without knowing what to do
with any of the devices it sees.
This patch makes sure the pointer is not NULL before accessing it.
Change-Id: Ia13191799d7e00185947f9df5188cb2666c43e2a
Signed-off-by: Huan Truong <htruong at tnhh.net>
---
util/intelmetool/intelmetool.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/util/intelmetool/intelmetool.c b/util/intelmetool/intelmetool.c
index 70b23fb..45e8c8f 100644
--- a/util/intelmetool/intelmetool.c
+++ b/util/intelmetool/intelmetool.c
@@ -137,7 +137,8 @@ static int pci_platform_scan() {
}
}
- if (!PCI_DEV_HAS_ME_DISABLE(dev->device_id) &&
+ if (dev != NULL &&
+ !PCI_DEV_HAS_ME_DISABLE(dev->device_id) &&
!PCI_DEV_HAS_ME_DIFFICULT(dev->device_id) &&
!PCI_DEV_CAN_DISABLE_ME_IF_PRESENT(dev->device_id) &&
!PCI_DEV_ME_NOT_SURE(dev->device_id)) {
More information about the coreboot-gerrit
mailing list