aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llmessage/message.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llmessage/message.cpp')
-rw-r--r--linden/indra/llmessage/message.cpp45
1 files changed, 44 insertions, 1 deletions
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)
535 if(!filename) 535 if(!filename)
536 { 536 {
537 llerrs << "No template filename specified" << llendl; 537 llerrs << "No template filename specified" << llendl;
538 mbError = TRUE;
539 return;
538 } 540 }
539 541
540 char token[MAX_MESSAGE_INTERNAL_NAME_SIZE]; /* Flawfinder: ignore */ 542 char token[MAX_MESSAGE_INTERNAL_NAME_SIZE]; /* Flawfinder: ignore */
@@ -655,6 +657,13 @@ void LLMessageSystem::loadTemplateFile(const char* filename)
655 // add data! 657 // add data!
656 // we've gotten a complete variable! hooray! 658 // we've gotten a complete variable! hooray!
657 // add it! 659 // add it!
660 if (NULL == templatep)
661 {
662 llerrs << "Trying to addTemplate a NULL templatep during load." << llendl;
663 mbError = TRUE;
664 fclose(messagefilep);
665 return;
666 }
658 addTemplate(templatep); 667 addTemplate(templatep);
659 668
660 //llinfos << "Read template: "templatep->mNametemp_str 669 //llinfos << "Read template: "templatep->mNametemp_str
@@ -672,7 +681,13 @@ void LLMessageSystem::loadTemplateFile(const char* filename)
672 // add data! 681 // add data!
673 // we've gotten a complete variable! hooray! 682 // we've gotten a complete variable! hooray!
674 // add it to template 683 // add it to template
675 684 if (NULL == templatep)
685 {
686 llerrs << "Trying to addBlock to NULL templatep during load." << llendl;
687 mbError = TRUE;
688 fclose(messagefilep);
689 return;
690 }
676 templatep->addBlock(blockp); 691 templatep->addBlock(blockp);
677 692
678 // start working on it! 693 // start working on it!
@@ -876,10 +891,24 @@ void LLMessageSystem::loadTemplateFile(const char* filename)
876 891
877 if (strcmp(token, "Trusted") == 0) 892 if (strcmp(token, "Trusted") == 0)
878 { 893 {
894 if (NULL == templatep)
895 {
896 llerrs << "Trying to setTrust for NULL templatep during load." << llendl;
897 mbError = TRUE;
898 fclose(messagefilep);
899 return;
900 }
879 templatep->setTrust(MT_TRUST); 901 templatep->setTrust(MT_TRUST);
880 } 902 }
881 else if (strcmp(token, "NotTrusted") == 0) 903 else if (strcmp(token, "NotTrusted") == 0)
882 { 904 {
905 if (NULL == templatep)
906 {
907 llerrs << "Trying to setTrust for NULL templatep during load." << llendl;
908 mbError = TRUE;
909 fclose(messagefilep);
910 return;
911 }
883 templatep->setTrust(MT_NOTRUST); 912 templatep->setTrust(MT_NOTRUST);
884 } 913 }
885 else 914 else
@@ -912,10 +941,24 @@ void LLMessageSystem::loadTemplateFile(const char* filename)
912 941
913 if(0 == strcmp(token, "Unencoded")) 942 if(0 == strcmp(token, "Unencoded"))
914 { 943 {
944 if (NULL == templatep)
945 {
946 llerrs << "Trying to setEncoding for NULL templatep during load." << llendl;
947 mbError = TRUE;
948 fclose(messagefilep);
949 return;
950 }
915 templatep->setEncoding(ME_UNENCODED); 951 templatep->setEncoding(ME_UNENCODED);
916 } 952 }
917 else if(0 == strcmp(token, "Zerocoded")) 953 else if(0 == strcmp(token, "Zerocoded"))
918 { 954 {
955 if (NULL == templatep)
956 {
957 llerrs << "Trying to setEncoding for NULL templatep during load." << llendl;
958 mbError = TRUE;
959 fclose(messagefilep);
960 return;
961 }
919 templatep->setEncoding(ME_ZEROCODED); 962 templatep->setEncoding(ME_ZEROCODED);
920 } 963 }
921 else 964 else