Merge pull request #111772 from nikitalita/fix-fmem-integer-underflow

Fix buffer over-read in `FileAccessMemory::get_buffer`
This commit is contained in:
Thaddeus Crews 2025-11-04 16:32:29 -06:00
commit cef4a7805f
No known key found for this signature in database
GPG key ID: 8C6E5FEB5FC03CCC

View file

@ -98,12 +98,14 @@ bool FileAccessMemory::is_open() const {
void FileAccessMemory::seek(uint64_t p_position) {
ERR_FAIL_NULL(data);
ERR_FAIL_COND(p_position > length);
pos = p_position;
}
void FileAccessMemory::seek_end(int64_t p_position) {
ERR_FAIL_NULL(data);
pos = length + p_position;
ERR_FAIL_COND((int64_t)length + p_position < 0);
seek(length + p_position);
}
uint64_t FileAccessMemory::get_position() const {