summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/llcommon/llmd5.cpp2
-rw-r--r--indra/llmessage/lltemplatemessagereader.cpp3
2 files changed, 5 insertions, 0 deletions
diff --git a/indra/llcommon/llmd5.cpp b/indra/llcommon/llmd5.cpp
index c8ca586e7f..ae7468aa22 100644
--- a/indra/llcommon/llmd5.cpp
+++ b/indra/llcommon/llmd5.cpp
@@ -262,6 +262,8 @@ void LLMD5::raw_digest(unsigned char* s) const
void LLMD5::hex_digest(char* s) const
{
+ if(!s) return;
+
if (!finalized)
{
std::cerr << "LLMD5::hex_digest: Can't get digest if you haven't "
diff --git a/indra/llmessage/lltemplatemessagereader.cpp b/indra/llmessage/lltemplatemessagereader.cpp
index b62288590e..850d73e910 100644
--- a/indra/llmessage/lltemplatemessagereader.cpp
+++ b/indra/llmessage/lltemplatemessagereader.cpp
@@ -118,6 +118,9 @@ void LLTemplateMessageReader::getData(const char *blockname, const char *varname
{
switch( vardata_size )
{
+ case 0:
+ // This is here to prevent a memcpy from a null value which is undefined behavior.
+ break;
case 1:
*((U8*)datap) = *((U8*)vardata.getData());
break;