Core/Packets: Changed ByteBuffer write exceptions into asserts (reading is unaffected as data comes from untrusted source - client)
This commit is contained in:
@@ -26,28 +26,17 @@ ByteBuffer::ByteBuffer(MessageBuffer&& buffer) : _rpos(0), _wpos(0), _bitpos(Ini
|
||||
{
|
||||
}
|
||||
|
||||
ByteBufferPositionException::ByteBufferPositionException(bool add, size_t pos, size_t size, size_t valueSize)
|
||||
ByteBufferPositionException::ByteBufferPositionException(size_t pos, size_t size, size_t valueSize)
|
||||
{
|
||||
std::ostringstream ss;
|
||||
|
||||
ss << "Attempted to " << (add ? "put" : "get") << " value with size: "
|
||||
ss << "Attempted to get value with size: "
|
||||
<< valueSize << " in ByteBuffer (pos: " << pos << " size: " << size
|
||||
<< ")";
|
||||
|
||||
message().assign(ss.str());
|
||||
}
|
||||
|
||||
ByteBufferSourceException::ByteBufferSourceException(size_t pos, size_t size, size_t valueSize)
|
||||
{
|
||||
std::ostringstream ss;
|
||||
|
||||
ss << "Attempted to put a "
|
||||
<< (valueSize > 0 ? "NULL-pointer" : "zero-sized value")
|
||||
<< " in ByteBuffer (pos: " << pos << " size: " << size << ")";
|
||||
|
||||
message().assign(ss.str());
|
||||
}
|
||||
|
||||
void ByteBuffer::print_storage() const
|
||||
{
|
||||
if (!sLog->ShouldLog("network", LOG_LEVEL_TRACE)) // optimize disabled trace output
|
||||
|
||||
Reference in New Issue
Block a user