mirror of
https://github.com/gbdev/rgbds.git
synced 2026-12-02 15:18:39 +00:00
Avoid unsigned overflow in INCBIN slice size check
This commit is contained in:
1 parent
760cc4d464
commit
b36028d1d1
1 file changed
+1
-1
+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