mirror of
https://github.com/gbdev/rgbds.git
synced 2026-08-29 10:05:15 +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
|
||||
);
|
||||
return false;
|
||||
} else if (startPos + length > *fileSize) {
|
||||
} else if (length > *fileSize - startPos) {
|
||||
error(
|
||||
"Specified range in `INCBIN` file \"%s\" is out of bounds (%" PRIu32 " + %" PRIu32
|
||||
" > %" PRIu64 ")",
|
||||
|
||||
Reference in New Issue
Block a user