mirror of
https://review.haiku-os.org/haiku
synced 2025-02-08 22:58:18 +01:00
f894ab70ea
The refactored version of Unflatten() encapsulated the raw buffer into a BMemoryIO with a specified size of SIZE_MAX, since the total size of the messageisn't known up front. On 32-bit this was no problem, but on x86_64, this would lead to an overflow in BMemoryIO, since it stores its internal length as a size_t, which on that platform is the same size as off_t. Consequently, when it would cast its length to off_t to compare against the requested seek position in ReadAt/WriteAt, this would overflow to a negative, leading it to reject all requests, which subsequently caused Unflatten() to fail.