summaryrefslogtreecommitdiff
path: root/indra/llmessage/message.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llmessage/message.cpp')
-rw-r--r--indra/llmessage/message.cpp45
1 files changed, 44 insertions, 1 deletions
diff --git a/indra/llmessage/message.cpp b/indra/llmessage/message.cpp
index 78d12cbda9..dfc18e0b2e 100644
--- a/indra/llmessage/message.cpp
+++ b/indra/llmessage/message.cpp
@@ -515,6 +515,8 @@ void LLMessageSystem::loadTemplateFile(const char* filename)
if(!filename)
{
llerrs << "No template filename specified" << llendl;
+ mbError = TRUE;
+ return;
}
char token[MAX_MESSAGE_INTERNAL_NAME_SIZE]; /* Flawfinder: ignore */
@@ -635,6 +637,13 @@ void LLMessageSystem::loadTemplateFile(const char* filename)
// add data!
// we've gotten a complete variable! hooray!
// add it!
+ if (NULL == templatep)
+ {
+ llerrs << "Trying to addTemplate a NULL templatep during load." << llendl;
+ mbError = TRUE;
+ fclose(messagefilep);
+ return;
+ }
addTemplate(templatep);
//llinfos << "Read template: "templatep->mNametemp_str
@@ -652,7 +661,13 @@ void LLMessageSystem::loadTemplateFile(const char* filename)
// add data!
// we've gotten a complete variable! hooray!
// add it to template
-
+ if (NULL == templatep)
+ {
+ llerrs << "Trying to addBlock to NULL templatep during load." << llendl;
+ mbError = TRUE;
+ fclose(messagefilep);
+ return;
+ }
templatep->addBlock(blockp);
// start working on it!
@@ -856,10 +871,24 @@ void LLMessageSystem::loadTemplateFile(const char* filename)
if (strcmp(token, "Trusted") == 0)
{
+ if (NULL == templatep)
+ {
+ llerrs << "Trying to setTrust for NULL templatep during load." << llendl;
+ mbError = TRUE;
+ fclose(messagefilep);
+ return;
+ }
templatep->setTrust(MT_TRUST);
}
else if (strcmp(token, "NotTrusted") == 0)
{
+ if (NULL == templatep)
+ {
+ llerrs << "Trying to setTrust for NULL templatep during load." << llendl;
+ mbError = TRUE;
+ fclose(messagefilep);
+ return;
+ }
templatep->setTrust(MT_NOTRUST);
}
else
@@ -892,10 +921,24 @@ void LLMessageSystem::loadTemplateFile(const char* filename)
if(0 == strcmp(token, "Unencoded"))
{
+ if (NULL == templatep)
+ {
+ llerrs << "Trying to setEncoding for NULL templatep during load." << llendl;
+ mbError = TRUE;
+ fclose(messagefilep);
+ return;
+ }
templatep->setEncoding(ME_UNENCODED);
}
else if(0 == strcmp(token, "Zerocoded"))
{
+ if (NULL == templatep)
+ {
+ llerrs << "Trying to setEncoding for NULL templatep during load." << llendl;
+ mbError = TRUE;
+ fclose(messagefilep);
+ return;
+ }
templatep->setEncoding(ME_ZEROCODED);
}
else