From c07901e29ed545bbb02e3bddf148fe1104b94e9f Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Fri, 15 Aug 2008 23:44:56 -0500 Subject: Second Life viewer sources 1.15.1.3 --- linden/indra/llmessage/message.cpp | 45 +++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) (limited to 'linden/indra/llmessage/message.cpp') diff --git a/linden/indra/llmessage/message.cpp b/linden/indra/llmessage/message.cpp index ef22b63..29f232c 100644 --- a/linden/indra/llmessage/message.cpp +++ b/linden/indra/llmessage/message.cpp @@ -535,6 +535,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 */ @@ -655,6 +657,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 @@ -672,7 +681,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! @@ -876,10 +891,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 @@ -912,10 +941,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 -- cgit v1.1