mirror of
https://github.com/SerenityOS/serenity
synced 2026-05-08 16:12:23 +02:00
We need some overflow checks due to the implementation of TmpFS. When size_t is 32 bits and off_t is 64 bits, we might overflow our KBuffer max size and confuse the KBuffer set_size code, causing a VERIFY failure. Make sure that resulting offset + size will fit in a size_t. Another constraint, we make sure that the resulting offset + size will be less than half of the maximum value of a size_t, because we double the KBuffer size each time we resize it.
9.3 KiB
9.3 KiB