mirror of
https://github.com/gbdev/rgbds.git
synced 2026-09-04 04:48:38 +00:00
Avoid unsigned overflow/truncation from bad offset values in invalid object files
This commit is contained in:
+1
-1
@@ -550,7 +550,7 @@ static void applyFilePatches(Section §ion, Section &dataSection) {
|
|||||||
verbosePrint(VERB_INFO, "Patching section \"%s\"...\n", section.name.c_str());
|
verbosePrint(VERB_INFO, "Patching section \"%s\"...\n", section.name.c_str());
|
||||||
for (Patch &patch : section.patches) {
|
for (Patch &patch : section.patches) {
|
||||||
int32_t value = computeRPNExpr(patch, *section.fileSymbols);
|
int32_t value = computeRPNExpr(patch, *section.fileSymbols);
|
||||||
uint16_t offset = patch.offset + section.offset;
|
uint32_t offset = patch.offset + section.offset;
|
||||||
|
|
||||||
uint8_t typeSizes[PATCHTYPE_INVALID] = {
|
uint8_t typeSizes[PATCHTYPE_INVALID] = {
|
||||||
1, // PATCHTYPE_BYTE
|
1, // PATCHTYPE_BYTE
|
||||||
|
|||||||
Reference in New Issue
Block a user