offset+length > size wraps when length is near MaxInt64, so the cap is skipped and make([]byte, length) can exhaust memory. Compare length against size-offset instead.