mirror of
https://github.com/gbdev/rgbds.git
synced 2026-09-04 21:07:06 +00:00
Avoid unsigned overflow in INCBIN slice size check
This commit is contained in:
+1
-1
@@ -1053,7 +1053,7 @@ bool sect_BinaryFileSlice(std::string const &name, uint32_t startPos, uint32_t l
|
|||||||
*fileSize
|
*fileSize
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
} else if (startPos + length > *fileSize) {
|
} else if (length > *fileSize - startPos) {
|
||||||
error(
|
error(
|
||||||
"Specified range in `INCBIN` file \"%s\" is out of bounds (%" PRIu32 " + %" PRIu32
|
"Specified range in `INCBIN` file \"%s\" is out of bounds (%" PRIu32 " + %" PRIu32
|
||||||
" > %" PRIu64 ")",
|
" > %" PRIu64 ")",
|
||||||
|
|||||||
Reference in New Issue
Block a user