|
Lines 743-753
verify_buffer_sbat (char *data, int datasize,
Link Here
|
| 743 |
* and ignore the section if it isn't. */ |
743 |
* and ignore the section if it isn't. */ |
| 744 |
if (Section->SizeOfRawData && |
744 |
if (Section->SizeOfRawData && |
| 745 |
Section->SizeOfRawData >= Section->Misc.VirtualSize) { |
745 |
Section->SizeOfRawData >= Section->Misc.VirtualSize) { |
|
|
746 |
uint64_t boundary; |
| 746 |
SBATBase = ImageAddress(data, datasize, |
747 |
SBATBase = ImageAddress(data, datasize, |
| 747 |
Section->PointerToRawData); |
748 |
Section->PointerToRawData); |
| 748 |
SBATSize = Section->SizeOfRawData; |
749 |
SBATSize = Section->SizeOfRawData; |
| 749 |
dprint(L"sbat section base:0x%lx size:0x%lx\n", |
750 |
dprint(L"sbat section base:0x%lx size:0x%lx\n", |
| 750 |
SBATBase, SBATSize); |
751 |
SBATBase, SBATSize); |
|
|
752 |
if (checked_add((uint64_t)SBATBase, SBATSize, &boundary) || |
| 753 |
(boundary > (uint64_t)data + datasize)) { |
| 754 |
perror(L"Section exceeds bounds of image\n"); |
| 755 |
return EFI_UNSUPPORTED; |
| 756 |
} |
| 751 |
} |
757 |
} |
| 752 |
} |
758 |
} |
| 753 |
|
759 |
|
| 754 |
- |
|
|