From 51ffb157498fc0136c6826ce416165734d5f1056 Mon Sep 17 00:00:00 2001 From: Beq Date: Mon, 30 Sep 2024 13:47:26 +0100 Subject: [PATCH] FIRE-34588 - Bugsplat due to unhandled runtime exception in datapacker Revert older change that throws throw an exception. FS had replaced the conditional check and bool return with an exception, but the exception is never caught. The return value is however checked so lets do that. --- indra/llmessage/lldatapacker.h | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/indra/llmessage/lldatapacker.h b/indra/llmessage/lldatapacker.h index 00cfcce5b4..8d4b575ac1 100644 --- a/indra/llmessage/lldatapacker.h +++ b/indra/llmessage/lldatapacker.h @@ -213,18 +213,9 @@ inline bool LLDataPackerBinaryBuffer::verifyLength(const S32 data_size, const ch { if (mWriteEnabled && (mCurBufferp - mBufferp) > mBufferSize - data_size) { - // Handle invalid packets by throwing an exception and a graceful continue - - //LL_WARNS() << "Buffer overflow in BinaryBuffer length verify, field name " << name << "!" << LL_ENDL; - //LL_WARNS() << "Current pos: " << (int)(mCurBufferp - mBufferp) << " Buffer size: " << mBufferSize << " Data size: " << data_size << LL_ENDL; - // return false; - - std::stringstream strm; - strm << "Buffer overflow in BinaryBuffer length verify, field name " << name << "!" << std::endl; - strm << "Current pos: " << (int)(mCurBufferp - mBufferp) << " Buffer size: " << mBufferSize << " Data size: " << data_size << std::endl; - throw nd::exceptions::xran( strm.str() ); - - // + LL_WARNS() << "Buffer overflow in BinaryBuffer length verify, field name " << name << "!" << LL_ENDL; + LL_WARNS() << "Current pos: " << (int)(mCurBufferp - mBufferp) << " Buffer size: " << mBufferSize << " Data size: " << data_size << LL_ENDL; + return false; } return true;