intel_extreme: check that vbt_header is in area

This commit is contained in:
Fredrik Holmqvist 2018-09-30 12:18:00 +02:00
parent 597837c788
commit 39a3fe56de

View File

@ -144,7 +144,7 @@ get_bios(void)
kVBIOSAddress, vbios.memory)); kVBIOSAddress, vbios.memory));
int vbtOffset = vbios.ReadWord(kVbtPointer); int vbtOffset = vbios.ReadWord(kVbtPointer);
if (vbtOffset >= kVBIOSSize) { if ((vbtOffset + sizeof(vbt_header)) >= kVBIOSSize) {
TRACE((DEVICE_NAME": bad VBT offset : 0x%x\n", vbtOffset)); TRACE((DEVICE_NAME": bad VBT offset : 0x%x\n", vbtOffset));
delete_area(vbios.area); delete_area(vbios.area);
return false; return false;
@ -156,7 +156,6 @@ get_bios(void)
delete_area(vbios.area); delete_area(vbios.area);
return false; return false;
} }
return true; return true;
} }