aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llviewermessage.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llviewermessage.cpp233
1 files changed, 134 insertions, 99 deletions
diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp
index 1b91f9d..41d24fd 100644
--- a/linden/indra/newview/llviewermessage.cpp
+++ b/linden/indra/newview/llviewermessage.cpp
@@ -314,7 +314,7 @@ void export_complete()
314 gExporterRequestID.setNull(); 314 gExporterRequestID.setNull();
315 gExportDirectory = ""; 315 gExportDirectory = "";
316 316
317 FILE *fXML = LLFile::fopen(gExportedFile.c_str(), "rb"); 317 FILE* fXML = LLFile::fopen(gExportedFile.c_str(), "rb"); /* Flawfinder: ignore */
318 fseek(fXML, 0, SEEK_END); 318 fseek(fXML, 0, SEEK_END);
319 U32 length = ftell(fXML); 319 U32 length = ftell(fXML);
320 fseek(fXML, 0, SEEK_SET); 320 fseek(fXML, 0, SEEK_SET);
@@ -330,8 +330,8 @@ void export_complete()
330 330
331 if (pos_check && pos_uuid) 331 if (pos_check && pos_uuid)
332 { 332 {
333 char image_uuid_str[UUID_STR_SIZE]; 333 char image_uuid_str[UUID_STR_SIZE]; /* Flawfinder: ignore */
334 memcpy(image_uuid_str, pos_uuid+2, UUID_STR_SIZE-1); 334 memcpy(image_uuid_str, pos_uuid+2, UUID_STR_SIZE-1); /* Flawfinder: ignore */
335 image_uuid_str[UUID_STR_SIZE-1] = 0; 335 image_uuid_str[UUID_STR_SIZE-1] = 0;
336 336
337 LLUUID image_uuid(image_uuid_str); 337 LLUUID image_uuid(image_uuid_str);
@@ -342,12 +342,15 @@ void export_complete()
342 if (itor != gImageChecksums.end()) 342 if (itor != gImageChecksums.end())
343 { 343 {
344 llinfos << "Replacing with checksum: " << itor->second << llendl; 344 llinfos << "Replacing with checksum: " << itor->second << llendl;
345 memcpy(&pos_check[10], itor->second.c_str(), 32); 345 if (itor->second.c_str() != NULL)
346 {
347 memcpy(&pos_check[10], itor->second.c_str(), 32); /* Flawfinder: ignore */
348 }
346 } 349 }
347 } 350 }
348 } 351 }
349 352
350 FILE *fXMLOut = LLFile::fopen(gExportedFile.c_str(), "wb"); 353 FILE* fXMLOut = LLFile::fopen(gExportedFile.c_str(), "wb"); /* Flawfinder: ignore */
351 fwrite(buffer, 1, length, fXMLOut); 354 fwrite(buffer, 1, length, fXMLOut);
352 fclose(fXMLOut); 355 fclose(fXMLOut);
353 356
@@ -400,7 +403,7 @@ void exported_j2c_complete(const LLTSCode status, void *user_data)
400 } 403 }
401 else 404 else
402 { 405 {
403 FILE *fIn = LLFile::fopen(filename.c_str(), "rb"); 406 FILE* fIn = LLFile::fopen(filename.c_str(), "rb"); /* Flawfinder: ignore */
404 if (fIn) 407 if (fIn)
405 { 408 {
406 LLPointer<LLImageJ2C> ImageUtility = new LLImageJ2C; 409 LLPointer<LLImageJ2C> ImageUtility = new LLImageJ2C;
@@ -425,22 +428,22 @@ void exported_j2c_complete(const LLTSCode status, void *user_data)
425 S32 data_size = TargaUtility->getDataSize(); 428 S32 data_size = TargaUtility->getDataSize();
426 429
427 char *file_path = new char[filename.size()+1]; 430 char *file_path = new char[filename.size()+1];
428 strcpy(file_path, filename.c_str()); 431 strcpy(file_path, filename.c_str()); /* Flawfinder: ignore */
429 char *end = strrchr(file_path, gDirUtilp->getDirDelimiter()[0]); 432 char *end = strrchr(file_path, gDirUtilp->getDirDelimiter()[0]);
430 end[0] = 0; 433 end[0] = 0;
431 LLString output_file = llformat("%s/image-%03d.tga", file_path, image_num);//filename; 434 LLString output_file = llformat("%s/image-%03d.tga", file_path, image_num);//filename;
432 delete file_path; 435 delete file_path;
433 //S32 name_len = output_file.length(); 436 //S32 name_len = output_file.length();
434 //strcpy(&output_file[name_len-3], "tga"); 437 //strcpy(&output_file[name_len-3], "tga");
435 FILE *fOut = LLFile::fopen(output_file.c_str(), "wb"); 438 FILE* fOut = LLFile::fopen(output_file.c_str(), "wb"); /* Flawfinder: ignore */
436 char md5_hash_string[33]; 439 char md5_hash_string[33]; /* Flawfinder: ignore */
437 strcpy(md5_hash_string, "00000000000000000000000000000000"); 440 strcpy(md5_hash_string, "00000000000000000000000000000000"); /* Flawfinder: ignore */
438 if (fOut) 441 if (fOut)
439 { 442 {
440 fwrite(data, 1, data_size, fOut); 443 fwrite(data, 1, data_size, fOut);
441 fseek(fOut, 0, SEEK_SET); 444 fseek(fOut, 0, SEEK_SET);
442 fclose(fOut); 445 fclose(fOut);
443 fOut = LLFile::fopen(output_file.c_str(), "rb"); 446 fOut = LLFile::fopen(output_file.c_str(), "rb"); /* Flawfinder: ignore */
444 LLMD5 my_md5_hash(fOut); 447 LLMD5 my_md5_hash(fOut);
445 my_md5_hash.hex_digest(md5_hash_string); 448 my_md5_hash.hex_digest(md5_hash_string);
446 } 449 }
@@ -801,7 +804,7 @@ void inventory_offer_callback(S32 option, void* user_data)
801 { 804 {
802 if (info->mFromGroup) 805 if (info->mFromGroup)
803 { 806 {
804 char group_name[MAX_STRING]; 807 char group_name[MAX_STRING]; /* Flawfinder: ignore */
805 if (gCacheName->getGroupName(info->mFromID, group_name)) 808 if (gCacheName->getGroupName(info->mFromID, group_name))
806 { 809 {
807 from_string = LLString("An object named ") + info->mFromName + " owned by the group '" + group_name + "'"; 810 from_string = LLString("An object named ") + info->mFromName + " owned by the group '" + group_name + "'";
@@ -813,8 +816,8 @@ void inventory_offer_callback(S32 option, void* user_data)
813 } 816 }
814 else 817 else
815 { 818 {
816 char first_name[MAX_STRING]; 819 char first_name[MAX_STRING]; /* Flawfinder: ignore */
817 char last_name[MAX_STRING]; 820 char last_name[MAX_STRING]; /* Flawfinder: ignore */
818 if (gCacheName->getName(info->mFromID, first_name, last_name)) 821 if (gCacheName->getName(info->mFromID, first_name, last_name))
819 { 822 {
820 from_string = LLString("An object named ") + info->mFromName + " owned by " + first_name + " " + last_name; 823 from_string = LLString("An object named ") + info->mFromName + " owned by " + first_name + " " + last_name;
@@ -938,9 +941,9 @@ void inventory_offer_callback(S32 option, void* user_data)
938 } 941 }
939 942
940 } 943 }
941 if (!info->mFromGroup) 944 if (!info->mFromGroup && !info->mFromObject)
942 { 945 {
943 busy_message(msg,info->mFromID); 946 busy_message(msg,info->mFromID);
944 } 947 }
945 break; 948 break;
946 } 949 }
@@ -1000,8 +1003,8 @@ void inventory_offer_handler(LLOfferInfo* info, BOOL from_task)
1000 // Name cache callbacks don't store userdata, so can't save 1003 // Name cache callbacks don't store userdata, so can't save
1001 // off the LLOfferInfo. Argh. JC 1004 // off the LLOfferInfo. Argh. JC
1002 BOOL name_found = FALSE; 1005 BOOL name_found = FALSE;
1003 char first_name[MAX_STRING]; 1006 char first_name[MAX_STRING]; /* Flawfinder: ignore */
1004 char last_name[MAX_STRING]; 1007 char last_name[MAX_STRING]; /* Flawfinder: ignore */
1005 if (info->mFromGroup) 1008 if (info->mFromGroup)
1006 { 1009 {
1007 if (gCacheName->getGroupName(info->mFromID, first_name)) 1010 if (gCacheName->getGroupName(info->mFromID, first_name))
@@ -1133,12 +1136,12 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
1133 U8 d = 0; 1136 U8 d = 0;
1134 LLUUID session_id; 1137 LLUUID session_id;
1135 U32 t; 1138 U32 t;
1136 char name[DB_FULL_NAME_BUF_SIZE]; 1139 char name[DB_FULL_NAME_BUF_SIZE]; /* Flawfinder: ignore */
1137 char message[DB_IM_MSG_BUF_SIZE]; 1140 char message[DB_IM_MSG_BUF_SIZE]; /* Flawfinder: ignore */
1138 U32 parent_estate_id = 0; 1141 U32 parent_estate_id = 0;
1139 LLUUID region_id; 1142 LLUUID region_id;
1140 LLVector3 position; 1143 LLVector3 position;
1141 char buffer[DB_IM_MSG_BUF_SIZE * 2]; 1144 char buffer[DB_IM_MSG_BUF_SIZE * 2]; /* Flawfinder: ignore */
1142 U8 binary_bucket[MTUBYTES]; 1145 U8 binary_bucket[MTUBYTES];
1143 S32 binary_bucket_size; 1146 S32 binary_bucket_size;
1144 LLChat chat; 1147 LLChat chat;
@@ -1171,19 +1174,19 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
1171 chat.mFromID = from_id; 1174 chat.mFromID = from_id;
1172 chat.mFromName = name; 1175 chat.mFromName = name;
1173 1176
1174 LLViewerObject *source = gObjectList.findObject(session_id); 1177 LLViewerObject *source = gObjectList.findObject(session_id); //Session ID is probably the wrong thing.
1175 if (source) 1178 if (source)
1176 { 1179 {
1177 is_owned_by_me = source->permYouOwner(); 1180 is_owned_by_me = source->permYouOwner();
1178 } 1181 }
1179 1182
1180 char separator_string[3]=": "; 1183 char separator_string[3]=": "; /* Flawfinder: ignore */
1181 int message_offset=0; 1184 int message_offset=0;
1182 1185
1183 //Handle IRC styled /me messages. 1186 //Handle IRC styled /me messages.
1184 if (!strncmp(message, "/me ", 4) || !strncmp(message, "/me'", 4)) 1187 if (!strncmp(message, "/me ", 4) || !strncmp(message, "/me'", 4))
1185 { 1188 {
1186 strcpy(separator_string,""); 1189 strcpy(separator_string,""); /* Flawfinder: ignore */
1187 message_offset=3; 1190 message_offset=3;
1188 } 1191 }
1189 1192
@@ -1237,7 +1240,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
1237 1240
1238 // now store incoming IM in chat history 1241 // now store incoming IM in chat history
1239 1242
1240 sprintf(buffer, "%s%s%s", name, separator_string, (message+message_offset)); 1243 snprintf(buffer, sizeof(buffer), "%s%s%s", name, separator_string, (message+message_offset)); /* Flawfinder: ignore */
1241 1244
1242 if(from_id == gAgentID) 1245 if(from_id == gAgentID)
1243 { 1246 {
@@ -1258,14 +1261,14 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
1258 position); 1261 position);
1259 1262
1260 // pretend this is chat generated by self, so it does not show up on screen 1263 // pretend this is chat generated by self, so it does not show up on screen
1261 sprintf(buffer, "IM: %s%s%s", name, separator_string, (message+message_offset)); 1264 snprintf(buffer, sizeof(buffer), "IM: %s%s%s", name, separator_string, (message+message_offset)); /* Flawfinder: ignore */
1262 chat.mText = buffer; 1265 chat.mText = buffer;
1263 LLFloaterChat::addChat( chat, TRUE, TRUE ); 1266 LLFloaterChat::addChat( chat, TRUE, TRUE );
1264 } 1267 }
1265 else if (from_id.isNull()) 1268 else if (from_id.isNull())
1266 { 1269 {
1267 // Messages from "Second Life" don't go to IM history 1270 // Messages from "Second Life" don't go to IM history
1268 sprintf(buffer, "%s: %s", name, message); 1271 snprintf(buffer, sizeof(buffer), "%s: %s", name, message); /* Flawfinder: ignore */
1269 chat.mText = buffer; 1272 chat.mText = buffer;
1270 LLFloaterChat::addChat(chat, FALSE, FALSE); 1273 LLFloaterChat::addChat(chat, FALSE, FALSE);
1271 } 1274 }
@@ -1279,7 +1282,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
1279 // Treat like a system message and put in chat history. 1282 // Treat like a system message and put in chat history.
1280 // Claim to be from a local agent so it doesn't go into 1283 // Claim to be from a local agent so it doesn't go into
1281 // console. 1284 // console.
1282 sprintf(buffer, "%s%s%s", name, separator_string, (message+message_offset)); 1285 snprintf(buffer, sizeof(buffer), "%s%s%s", name, separator_string, (message+message_offset)); /* Flawfinder: ignore */
1283 chat.mText = buffer; 1286 chat.mText = buffer;
1284 BOOL local_agent = TRUE; 1287 BOOL local_agent = TRUE;
1285 LLFloaterChat::addChat(chat, FALSE, local_agent); 1288 LLFloaterChat::addChat(chat, FALSE, local_agent);
@@ -1287,15 +1290,15 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
1287 else 1290 else
1288 { 1291 {
1289 // standard message, not from system 1292 // standard message, not from system
1290 char saved[MAX_STRING]; 1293 char saved[MAX_STRING]; /* Flawfinder: ignore */
1291 saved[0] = '\0'; 1294 saved[0] = '\0';
1292 if(offline == IM_OFFLINE) 1295 if(offline == IM_OFFLINE)
1293 { 1296 {
1294 char time_buf[TIME_STR_LENGTH]; 1297 char time_buf[TIME_STR_LENGTH]; /* Flawfinder: ignore */
1295 sprintf(saved, "(Saved %s) ", 1298 snprintf(saved, MAX_STRING, "(Saved %s) ", /* Flawfinder: ignore */
1296 formatted_time(timestamp, time_buf)); 1299 formatted_time(timestamp, time_buf));
1297 } 1300 }
1298 sprintf(buffer, "%s%s%s%s", name, separator_string, saved,(message+message_offset)); 1301 snprintf(buffer, sizeof(buffer), "%s%s%s%s", name, separator_string, saved,(message+message_offset)); /* Flawfinder: ignore */
1299 if(from_id == gAgentID) 1302 if(from_id == gAgentID)
1300 { 1303 {
1301 from_id = LLUUID::null; 1304 from_id = LLUUID::null;
@@ -1314,7 +1317,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
1314 parent_estate_id, 1317 parent_estate_id,
1315 region_id, 1318 region_id,
1316 position); 1319 position);
1317 sprintf(buffer, "IM: %s%s%s%s", name, separator_string, saved, (message+message_offset)); 1320 snprintf(buffer, sizeof(buffer), "IM: %s%s%s%s", name, separator_string, saved, (message+message_offset)); /* Flawfinder: ignore */
1318 1321
1319 chat.mText = buffer; 1322 chat.mText = buffer;
1320 BOOL local_agent = FALSE; 1323 BOOL local_agent = FALSE;
@@ -1373,7 +1376,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
1373 1376
1374 // Make sure the binary bucket is big enough to hold the header 1377 // Make sure the binary bucket is big enough to hold the header
1375 // and a null terminated item name. 1378 // and a null terminated item name.
1376 if ( (binary_bucket_size < (sizeof(notice_bucket_header_t) + sizeof(U8))) 1379 if ( (binary_bucket_size < (S32)((sizeof(notice_bucket_header_t) + sizeof(U8))))
1377 || (binary_bucket[binary_bucket_size - 1] != '\0') ) 1380 || (binary_bucket[binary_bucket_size - 1] != '\0') )
1378 { 1381 {
1379 llwarns << "Malformed group notice binary bucket" << llendl; 1382 llwarns << "Malformed group notice binary bucket" << llendl;
@@ -1527,8 +1530,8 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
1527 info->mFromName = name; 1530 info->mFromName = name;
1528 info->mDesc = message; 1531 info->mDesc = message;
1529 info->mHost = msg->getSender(); 1532 info->mHost = msg->getSender();
1530 //if (!is_linden && ((is_busy && !is_owned_by_me) || is_muted)) 1533 //if (((is_busy && !is_owned_by_me) || is_muted))
1531 if (((is_busy && !is_owned_by_me) || is_muted)) 1534 if ( is_muted )
1532 { 1535 {
1533 // Same as closing window 1536 // Same as closing window
1534 inventory_offer_callback(-1, info); 1537 inventory_offer_callback(-1, info);
@@ -1578,16 +1581,17 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
1578 } 1581 }
1579 1582
1580 // standard message, not from system 1583 // standard message, not from system
1581 char saved[MAX_STRING]; 1584 char saved[MAX_STRING]; /* Flawfinder: ignore */
1582 saved[0] = '\0'; 1585 saved[0] = '\0';
1583 if(offline == IM_OFFLINE) 1586 if(offline == IM_OFFLINE)
1584 { 1587 {
1585 char time_buf[TIME_STR_LENGTH]; 1588 char time_buf[TIME_STR_LENGTH]; /* Flawfinder: ignore */
1586 sprintf(saved, 1589 snprintf(saved, /* Flawfinder: ignore */
1590 MAX_STRING,
1587 "(Saved %s) ", 1591 "(Saved %s) ",
1588 formatted_time(timestamp, time_buf)); 1592 formatted_time(timestamp, time_buf));
1589 } 1593 }
1590 sprintf(buffer, "%s%s%s%s", name, separator_string, saved, (message+message_offset)); 1594 snprintf(buffer, sizeof(buffer), "%s%s%s%s", name, separator_string, saved, (message+message_offset)); /* Flawfinder: ignore */
1591 BOOL is_this_agent = FALSE; 1595 BOOL is_this_agent = FALSE;
1592 if(from_id == gAgentID) 1596 if(from_id == gAgentID)
1593 { 1597 {
@@ -1605,7 +1609,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
1605 region_id, 1609 region_id,
1606 position); 1610 position);
1607 1611
1608 sprintf(buffer, "IM: %s%s%s%s", name, separator_string, saved, (message+message_offset)); 1612 snprintf(buffer, sizeof(buffer), "IM: %s%s%s%s", name, separator_string, saved, (message+message_offset)); /* Flawfinder: ignore */
1609 chat.mText = buffer; 1613 chat.mText = buffer;
1610 LLFloaterChat::addChat(chat, TRUE, is_this_agent); 1614 LLFloaterChat::addChat(chat, TRUE, is_this_agent);
1611 } 1615 }
@@ -1616,7 +1620,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
1616 { 1620 {
1617 return; 1621 return;
1618 } 1622 }
1619 sprintf(buffer, "%s%s%s", name, separator_string, (message+message_offset)); 1623 snprintf(buffer, sizeof(buffer), "%s%s%s", name, separator_string, (message+message_offset)); /* Flawfinder: ignore */
1620 // Note: lie to LLFloaterChat::addChat(), pretending that this is NOT an IM, because 1624 // Note: lie to LLFloaterChat::addChat(), pretending that this is NOT an IM, because
1621 // IMs from objcts don't open IM sessions. 1625 // IMs from objcts don't open IM sessions.
1622 chat.mText = buffer; 1626 chat.mText = buffer;
@@ -1636,7 +1640,17 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
1636 } 1640 }
1637 break; 1641 break;
1638 case IM_BUSY_AUTO_RESPONSE: 1642 case IM_BUSY_AUTO_RESPONSE:
1639 gIMView->addMessage(session_id, from_id, name, message); 1643 // fix for JIRA issue VWR-20 submitted 13-JAN-2007 - Paul Churchill
1644 if (is_muted)
1645 {
1646 lldebugs << "Ignoring busy response from " << from_id << llendl;
1647 return;
1648 }
1649 else
1650 {
1651 // original code resumes
1652 gIMView->addMessage(session_id, from_id, name, message);
1653 }
1640 break; 1654 break;
1641 1655
1642 case IM_LURE_USER: 1656 case IM_LURE_USER:
@@ -1688,7 +1702,14 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
1688 case IM_GOTO_URL: 1702 case IM_GOTO_URL:
1689 { 1703 {
1690 char* url = new char[binary_bucket_size]; 1704 char* url = new char[binary_bucket_size];
1691 strcpy(url, (char*)binary_bucket); 1705 if (url == NULL)
1706 {
1707 llerrs << "Memory Allocation failed" << llendl;
1708 return;
1709 }
1710
1711 strncpy(url, (char*)binary_bucket, binary_bucket_size-1); /* Flawfinder: ignore */
1712 url[binary_bucket_size-1] = '\0';
1692 args["[MESSAGE]"] = message; 1713 args["[MESSAGE]"] = message;
1693 args["[URL]"] = url; 1714 args["[URL]"] = url;
1694 LLNotifyBox::showXml("GotoURL", args, 1715 LLNotifyBox::showXml("GotoURL", args,
@@ -1730,7 +1751,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
1730 LLAvatarTracker::formFriendship(from_id); 1751 LLAvatarTracker::formFriendship(from_id);
1731 1752
1732 std::vector<std::string> strings; 1753 std::vector<std::string> strings;
1733 strings.push_back( from_id.getString() ); 1754 strings.push_back(from_id.asString());
1734 send_generic_message("requestonlinenotification", strings); 1755 send_generic_message("requestonlinenotification", strings);
1735 1756
1736 args["[NAME]"] = name; 1757 args["[NAME]"] = name;
@@ -1931,8 +1952,8 @@ void process_decline_callingcard(LLMessageSystem* msg, void**)
1931void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) 1952void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
1932{ 1953{
1933 LLChat chat; 1954 LLChat chat;
1934 char mesg[DB_CHAT_MSG_BUF_SIZE]; 1955 char mesg[DB_CHAT_MSG_BUF_SIZE]; /* Flawfinder: ignore */
1935 char from_name[DB_FULL_NAME_BUF_SIZE]; 1956 char from_name[DB_FULL_NAME_BUF_SIZE]; /* Flawfinder: ignore */
1936 U8 source_temp; 1957 U8 source_temp;
1937 U8 type_temp; 1958 U8 type_temp;
1938 U8 audible_temp; 1959 U8 audible_temp;
@@ -1976,6 +1997,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
1976 is_linden = gMuteListp->isLinden(from_name); 1997 is_linden = gMuteListp->isLinden(from_name);
1977 } 1998 }
1978 1999
2000 BOOL is_audible = (CHAT_AUDIBLE_FULLY == chat.mAudible);
1979 chatter = gObjectList.findObject(from_id); 2001 chatter = gObjectList.findObject(from_id);
1980 if (chatter) 2002 if (chatter)
1981 { 2003 {
@@ -1995,7 +2017,8 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
1995 } 2017 }
1996 2018
1997 // only pay attention to other people chatting 2019 // only pay attention to other people chatting
1998 if ((is_linden || (!is_muted && !is_busy)) 2020 if (is_audible
2021 && (is_linden || (!is_muted && !is_busy))
1999 && chatter != gAgent.getAvatarObject()) 2022 && chatter != gAgent.getAvatarObject())
2000 { 2023 {
2001 gAgent.heardChat(chat); 2024 gAgent.heardChat(chat);
@@ -2008,7 +2031,6 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
2008 is_owned_by_me = chatter->permYouOwner(); 2031 is_owned_by_me = chatter->permYouOwner();
2009 } 2032 }
2010 2033
2011 BOOL is_audible = (CHAT_AUDIBLE_FULLY == chat.mAudible);
2012 if (is_audible) 2034 if (is_audible)
2013 { 2035 {
2014 BOOL visible_in_chat_bubble = FALSE; 2036 BOOL visible_in_chat_bubble = FALSE;
@@ -2283,7 +2305,7 @@ void process_teleport_progress(LLMessageSystem* msg, void**)
2283 { 2305 {
2284 gViewerWindow->setProgressCancelButtonVisible(TRUE, "Cancel"); 2306 gViewerWindow->setProgressCancelButtonVisible(TRUE, "Cancel");
2285 } 2307 }
2286 char buffer[MAX_STRING]; 2308 char buffer[MAX_STRING]; /* Flawfinder: ignore */
2287 msg->getString("Info", "Message", MAX_STRING, buffer); 2309 msg->getString("Info", "Message", MAX_STRING, buffer);
2288 lldebugs << "teleport progress: " << buffer << llendl; 2310 lldebugs << "teleport progress: " << buffer << llendl;
2289 gAgent.setTeleportMessage(buffer); 2311 gAgent.setTeleportMessage(buffer);
@@ -2373,7 +2395,7 @@ void process_teleport_finish(LLMessageSystem* msg, void**)
2373 msg->getU32Fast(_PREHASH_Info, _PREHASH_TeleportFlags, teleport_flags); 2395 msg->getU32Fast(_PREHASH_Info, _PREHASH_TeleportFlags, teleport_flags);
2374 2396
2375 2397
2376 char seedCap[STD_STRING_BUF_SIZE]; 2398 char seedCap[STD_STRING_BUF_SIZE]; /* Flawfinder: ignore */
2377 msg->getStringFast(_PREHASH_Info, _PREHASH_SeedCapability, 2399 msg->getStringFast(_PREHASH_Info, _PREHASH_SeedCapability,
2378 STD_STRING_BUF_SIZE, seedCap); 2400 STD_STRING_BUF_SIZE, seedCap);
2379 2401
@@ -2657,7 +2679,7 @@ void process_crossed_region(LLMessageSystem* msg, void**)
2657 U64 region_handle; 2679 U64 region_handle;
2658 msg->getU64Fast(_PREHASH_RegionData, _PREHASH_RegionHandle, region_handle); 2680 msg->getU64Fast(_PREHASH_RegionData, _PREHASH_RegionHandle, region_handle);
2659 2681
2660 char seedCap[STD_STRING_BUF_SIZE]; 2682 char seedCap[STD_STRING_BUF_SIZE]; /* Flawfinder: ignore */
2661 msg->getStringFast(_PREHASH_RegionData, _PREHASH_SeedCapability, STD_STRING_BUF_SIZE, seedCap); 2683 msg->getStringFast(_PREHASH_RegionData, _PREHASH_SeedCapability, STD_STRING_BUF_SIZE, seedCap);
2662 2684
2663 send_complete_agent_movement(sim_host); 2685 send_complete_agent_movement(sim_host);
@@ -2891,7 +2913,8 @@ void send_agent_update(BOOL force_send, BOOL send_reliable)
2891extern U32 gObjectBits; 2913extern U32 gObjectBits;
2892 2914
2893void process_object_update(LLMessageSystem *mesgsys, void **user_data) 2915void process_object_update(LLMessageSystem *mesgsys, void **user_data)
2894{ 2916{
2917 LLMemType mt(LLMemType::MTYPE_OBJECT);
2895 // Update the data counters 2918 // Update the data counters
2896 if (mesgsys->getReceiveCompressedSize()) 2919 if (mesgsys->getReceiveCompressedSize())
2897 { 2920 {
@@ -2909,6 +2932,7 @@ void process_object_update(LLMessageSystem *mesgsys, void **user_data)
2909 2932
2910void process_compressed_object_update(LLMessageSystem *mesgsys, void **user_data) 2933void process_compressed_object_update(LLMessageSystem *mesgsys, void **user_data)
2911{ 2934{
2935 LLMemType mt(LLMemType::MTYPE_OBJECT);
2912 // Update the data counters 2936 // Update the data counters
2913 if (mesgsys->getReceiveCompressedSize()) 2937 if (mesgsys->getReceiveCompressedSize())
2914 { 2938 {
@@ -2926,6 +2950,7 @@ void process_compressed_object_update(LLMessageSystem *mesgsys, void **user_data
2926 2950
2927void process_cached_object_update(LLMessageSystem *mesgsys, void **user_data) 2951void process_cached_object_update(LLMessageSystem *mesgsys, void **user_data)
2928{ 2952{
2953 LLMemType mt(LLMemType::MTYPE_OBJECT);
2929 // Update the data counters 2954 // Update the data counters
2930 if (mesgsys->getReceiveCompressedSize()) 2955 if (mesgsys->getReceiveCompressedSize())
2931 { 2956 {
@@ -2944,6 +2969,7 @@ void process_cached_object_update(LLMessageSystem *mesgsys, void **user_data)
2944 2969
2945void process_terse_object_update_improved(LLMessageSystem *mesgsys, void **user_data) 2970void process_terse_object_update_improved(LLMessageSystem *mesgsys, void **user_data)
2946{ 2971{
2972 LLMemType mt(LLMemType::MTYPE_OBJECT);
2947 if (mesgsys->getReceiveCompressedSize()) 2973 if (mesgsys->getReceiveCompressedSize())
2948 { 2974 {
2949 gObjectBits += mesgsys->getReceiveCompressedSize() * 8; 2975 gObjectBits += mesgsys->getReceiveCompressedSize() * 8;
@@ -2988,7 +3014,7 @@ void process_kill_object(LLMessageSystem *mesgsys, void **user_data)
2988 //llinfos << "Kill message for local " << local_id << llendl; 3014 //llinfos << "Kill message for local " << local_id << llendl;
2989 } 3015 }
2990 3016
2991 gSelectMgr->selectionRemoveObject(id); 3017 gSelectMgr->removeObjectFromSelections(id);
2992 3018
2993 // ...don't kill the avatar 3019 // ...don't kill the avatar
2994 if (!(id == gAgentID)) 3020 if (!(id == gAgentID))
@@ -3470,12 +3496,15 @@ void process_camera_constraint(LLMessageSystem *mesgsys, void **user_data)
3470 3496
3471void near_sit_object(BOOL success, void *data) 3497void near_sit_object(BOOL success, void *data)
3472{ 3498{
3473 // Send message to sit on object 3499 if (success)
3474 gMessageSystem->newMessageFast(_PREHASH_AgentSit); 3500 {
3475 gMessageSystem->nextBlockFast(_PREHASH_AgentData); 3501 // Send message to sit on object
3476 gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); 3502 gMessageSystem->newMessageFast(_PREHASH_AgentSit);
3477 gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); 3503 gMessageSystem->nextBlockFast(_PREHASH_AgentData);
3478 gAgent.sendReliableMessage(); 3504 gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
3505 gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
3506 gAgent.sendReliableMessage();
3507 }
3479} 3508}
3480 3509
3481void process_avatar_sit_response(LLMessageSystem *mesgsys, void **user_data) 3510void process_avatar_sit_response(LLMessageSystem *mesgsys, void **user_data)
@@ -3516,9 +3545,6 @@ void process_avatar_sit_response(LLMessageSystem *mesgsys, void **user_data)
3516 { 3545 {
3517 gAgent.startAutoPilotGlobal(gAgent.getPosGlobalFromAgent(sit_spot), "Sit", &sitRotation, near_sit_object, NULL, 0.5f); 3546 gAgent.startAutoPilotGlobal(gAgent.getPosGlobalFromAgent(sit_spot), "Sit", &sitRotation, near_sit_object, NULL, 0.5f);
3518 } 3547 }
3519
3520 // deselect transient selections (pie menu) when sitting
3521 gSelectMgr->deselectTransient();
3522 } 3548 }
3523 else 3549 else
3524 { 3550 {
@@ -3658,7 +3684,7 @@ void process_set_follow_cam_properties(LLMessageSystem *mesgsys, void **user_dat
3658// Culled from newsim lltask.cpp 3684// Culled from newsim lltask.cpp
3659void process_name_value(LLMessageSystem *mesgsys, void **user_data) 3685void process_name_value(LLMessageSystem *mesgsys, void **user_data)
3660{ 3686{
3661 char temp_str[NAME_VALUE_BUF_SIZE]; 3687 char temp_str[NAME_VALUE_BUF_SIZE]; /* Flawfinder: ignore */
3662 LLUUID id; 3688 LLUUID id;
3663 S32 i, num_blocks; 3689 S32 i, num_blocks;
3664 3690
@@ -3684,7 +3710,7 @@ void process_name_value(LLMessageSystem *mesgsys, void **user_data)
3684 3710
3685void process_remove_name_value(LLMessageSystem *mesgsys, void **user_data) 3711void process_remove_name_value(LLMessageSystem *mesgsys, void **user_data)
3686{ 3712{
3687 char temp_str[NAME_VALUE_BUF_SIZE]; 3713 char temp_str[NAME_VALUE_BUF_SIZE]; /* Flawfinder: ignore */
3688 LLUUID id; 3714 LLUUID id;
3689 S32 i, num_blocks; 3715 S32 i, num_blocks;
3690 3716
@@ -3710,7 +3736,7 @@ void process_remove_name_value(LLMessageSystem *mesgsys, void **user_data)
3710 3736
3711void process_kick_user(LLMessageSystem *msg, void** /*user_data*/) 3737void process_kick_user(LLMessageSystem *msg, void** /*user_data*/)
3712{ 3738{
3713 char message[2048]; 3739 char message[2048]; /* Flawfinder: ignore */
3714 message[0] = '\0'; 3740 message[0] = '\0';
3715 3741
3716 msg->getStringFast(_PREHASH_UserInfo, _PREHASH_Reason, 2048, message); 3742 msg->getStringFast(_PREHASH_UserInfo, _PREHASH_Reason, 2048, message);
@@ -3778,7 +3804,7 @@ void process_money_balance_reply( LLMessageSystem* msg, void** )
3778 S32 balance = 0; 3804 S32 balance = 0;
3779 S32 credit = 0; 3805 S32 credit = 0;
3780 S32 committed = 0; 3806 S32 committed = 0;
3781 char desc[STD_STRING_BUF_SIZE] = ""; 3807 char desc[STD_STRING_BUF_SIZE] = ""; /* Flawfinder: ignore */
3782 3808
3783 msg->getS32("MoneyData", "MoneyBalance", balance); 3809 msg->getS32("MoneyData", "MoneyBalance", balance);
3784 msg->getS32("MoneyData", "SquareMetersCredit", credit); 3810 msg->getS32("MoneyData", "SquareMetersCredit", credit);
@@ -3839,7 +3865,7 @@ void process_money_balance_reply( LLMessageSystem* msg, void** )
3839 3865
3840void process_agent_alert_message(LLMessageSystem* msgsystem, void** user_data) 3866void process_agent_alert_message(LLMessageSystem* msgsystem, void** user_data)
3841{ 3867{
3842 char buffer[MAX_STRING]; 3868 char buffer[MAX_STRING]; /* Flawfinder: ignore */
3843 msgsystem->getStringFast(_PREHASH_AlertData, _PREHASH_Message, MAX_STRING, buffer); 3869 msgsystem->getStringFast(_PREHASH_AlertData, _PREHASH_Message, MAX_STRING, buffer);
3844 BOOL modal = FALSE; 3870 BOOL modal = FALSE;
3845 msgsystem->getBOOL("AlertData", "Modal", modal); 3871 msgsystem->getBOOL("AlertData", "Modal", modal);
@@ -3848,7 +3874,7 @@ void process_agent_alert_message(LLMessageSystem* msgsystem, void** user_data)
3848 3874
3849void process_alert_message(LLMessageSystem *msgsystem, void **user_data) 3875void process_alert_message(LLMessageSystem *msgsystem, void **user_data)
3850{ 3876{
3851 char buffer[MAX_STRING]; 3877 char buffer[MAX_STRING]; /* Flawfinder: ignore */
3852 msgsystem->getStringFast(_PREHASH_AlertData, _PREHASH_Message, MAX_STRING, buffer); 3878 msgsystem->getStringFast(_PREHASH_AlertData, _PREHASH_Message, MAX_STRING, buffer);
3853 BOOL modal = FALSE; 3879 BOOL modal = FALSE;
3854 process_alert_core(buffer, modal); 3880 process_alert_core(buffer, modal);
@@ -3868,10 +3894,11 @@ void process_alert_core(const char* buffer, BOOL modal)
3868 else if( !strcmp( buffer, "Home position set." ) ) 3894 else if( !strcmp( buffer, "Home position set." ) )
3869 { 3895 {
3870 // save the home location image to disk 3896 // save the home location image to disk
3871 char temp_str[LL_MAX_PATH]; 3897 char temp_str[LL_MAX_PATH]; /* Flawfinder: ignore */
3872 strcpy(temp_str, gDirUtilp->getLindenUserDir().c_str()); 3898 strncpy(temp_str, gDirUtilp->getLindenUserDir().c_str(), LL_MAX_PATH -1); /* Flawfinder: ignore */
3873 strcat(temp_str, "/"); 3899 temp_str[LL_MAX_PATH -1] = '\0';
3874 strcat(temp_str,SCREEN_HOME_FILENAME); 3900 strcat(temp_str, "/"); /* Flawfinder: ignore */
3901 strcat(temp_str,SCREEN_HOME_FILENAME); /* Flawfinder: ignore */
3875 gViewerWindow->saveSnapshot(temp_str, gViewerWindow->getWindowWidth(), gViewerWindow->getWindowHeight(), FALSE, FALSE); 3902 gViewerWindow->saveSnapshot(temp_str, gViewerWindow->getWindowWidth(), gViewerWindow->getWindowHeight(), FALSE, FALSE);
3876 } 3903 }
3877 3904
@@ -3949,8 +3976,10 @@ void mean_name_callback(const LLUUID &id, const char *first, const char *last, B
3949 { 3976 {
3950 if (mcd->mPerp == id) 3977 if (mcd->mPerp == id)
3951 { 3978 {
3952 strcpy(mcd->mFirstName, first); 3979 strncpy(mcd->mFirstName, first, DB_FIRST_NAME_BUF_SIZE -1); /* Flawfinder: ignore */
3953 strcpy(mcd->mLastName, last); 3980 mcd->mFirstName[DB_FIRST_NAME_BUF_SIZE -1] = '\0';
3981 strncpy(mcd->mLastName, last, DB_LAST_NAME_BUF_SIZE -1); /* Flawfinder: ignore */
3982 mcd->mLastName[DB_LAST_NAME_BUF_SIZE -1] = '\0';
3954 } 3983 }
3955 } 3984 }
3956} 3985}
@@ -4101,8 +4130,8 @@ void process_script_question(LLMessageSystem *msg, void **user_data)
4101 LLUUID taskid; 4130 LLUUID taskid;
4102 LLUUID itemid; 4131 LLUUID itemid;
4103 S32 questions; 4132 S32 questions;
4104 char object_name[255]; 4133 char object_name[255]; /* Flawfinder: ignore */
4105 char owner_name[DB_FULL_NAME_BUF_SIZE]; 4134 char owner_name[DB_FULL_NAME_BUF_SIZE]; /* Flawfinder: ignore */
4106 4135
4107 msg->getUUIDFast(_PREHASH_Data, _PREHASH_TaskID, taskid ); 4136 msg->getUUIDFast(_PREHASH_Data, _PREHASH_TaskID, taskid );
4108 msg->getUUIDFast(_PREHASH_Data, _PREHASH_ItemID, itemid ); 4137 msg->getUUIDFast(_PREHASH_Data, _PREHASH_ItemID, itemid );
@@ -4262,7 +4291,7 @@ char* formatted_time(const time_t& the_time, char* buffer)
4262 4291
4263void process_teleport_failed(LLMessageSystem *msg, void**) 4292void process_teleport_failed(LLMessageSystem *msg, void**)
4264{ 4293{
4265 char reason[STD_STRING_BUF_SIZE]; 4294 char reason[STD_STRING_BUF_SIZE]; /* Flawfinder: ignore */
4266 msg->getStringFast(_PREHASH_Info, _PREHASH_Reason, STD_STRING_BUF_SIZE, reason); 4295 msg->getStringFast(_PREHASH_Info, _PREHASH_Reason, STD_STRING_BUF_SIZE, reason);
4267 4296
4268 LLStringBase<char>::format_map_t args; 4297 LLStringBase<char>::format_map_t args;
@@ -4536,10 +4565,10 @@ void process_user_info_reply(LLMessageSystem* msg, void**)
4536 4565
4537 BOOL im_via_email; 4566 BOOL im_via_email;
4538 msg->getBOOLFast(_PREHASH_UserData, _PREHASH_IMViaEMail, im_via_email); 4567 msg->getBOOLFast(_PREHASH_UserData, _PREHASH_IMViaEMail, im_via_email);
4539 char email[DB_USER_EMAIL_ADDR_BUF_SIZE]; 4568 char email[DB_USER_EMAIL_ADDR_BUF_SIZE]; /* Flawfinder: ignore */
4540 msg->getStringFast(_PREHASH_UserData, _PREHASH_EMail, DB_USER_EMAIL_ADDR_BUF_SIZE, 4569 msg->getStringFast(_PREHASH_UserData, _PREHASH_EMail, DB_USER_EMAIL_ADDR_BUF_SIZE,
4541 email); 4570 email);
4542 char dir_visibility[MAX_STRING]; 4571 char dir_visibility[MAX_STRING]; /* Flawfinder: ignore */
4543 msg->getString( 4572 msg->getString(
4544 "UserData", "DirectoryVisibility", MAX_STRING, dir_visibility); 4573 "UserData", "DirectoryVisibility", MAX_STRING, dir_visibility);
4545 4574
@@ -4596,11 +4625,11 @@ void process_script_dialog(LLMessageSystem* msg, void**)
4596 ScriptDialogInfo* info = new ScriptDialogInfo; 4625 ScriptDialogInfo* info = new ScriptDialogInfo;
4597 4626
4598 const S32 messageLength = SCRIPT_DIALOG_MAX_MESSAGE_SIZE + sizeof(SCRIPT_DIALOG_HEADER); 4627 const S32 messageLength = SCRIPT_DIALOG_MAX_MESSAGE_SIZE + sizeof(SCRIPT_DIALOG_HEADER);
4599 char message[messageLength]; // Account for size of "Script Dialog:\n" 4628 char message[messageLength]; /* Flawfinder: ignore */ // Account for size of "Script Dialog:\n"
4600 4629
4601 char first_name[DB_FIRST_NAME_BUF_SIZE]; 4630 char first_name[DB_FIRST_NAME_BUF_SIZE]; /* Flawfinder: ignore */
4602 char last_name[DB_GROUP_NAME_BUF_SIZE]; 4631 char last_name[DB_GROUP_NAME_BUF_SIZE]; /* Flawfinder: ignore */
4603 char title[DB_INV_ITEM_NAME_BUF_SIZE]; 4632 char title[DB_INV_ITEM_NAME_BUF_SIZE]; /* Flawfinder: ignore */
4604 info->mSender = msg->getSender(); 4633 info->mSender = msg->getSender();
4605 4634
4606 msg->getUUID("Data", "ObjectID", info->mObjectID); 4635 msg->getUUID("Data", "ObjectID", info->mObjectID);
@@ -4622,7 +4651,7 @@ void process_script_dialog(LLMessageSystem* msg, void**)
4622 4651
4623 for (i = 0; i < button_count; i++) 4652 for (i = 0; i < button_count; i++)
4624 { 4653 {
4625 char tdesc[SCRIPT_DIALOG_BUTTON_STR_SIZE+1]; 4654 char tdesc[SCRIPT_DIALOG_BUTTON_STR_SIZE+1]; /* Flawfinder: ignore */
4626 msg->getString("Buttons", "ButtonLabel", SCRIPT_DIALOG_BUTTON_STR_SIZE + 1, tdesc, i); 4655 msg->getString("Buttons", "ButtonLabel", SCRIPT_DIALOG_BUTTON_STR_SIZE + 1, tdesc, i);
4627 info->mButtons.push_back(LLString(tdesc)); 4656 info->mButtons.push_back(LLString(tdesc));
4628 } 4657 }
@@ -4630,7 +4659,7 @@ void process_script_dialog(LLMessageSystem* msg, void**)
4630 LLStringBase<char>::format_map_t args; 4659 LLStringBase<char>::format_map_t args;
4631 args["[TITLE]"] = title; 4660 args["[TITLE]"] = title;
4632 args["[MESSAGE]"] = message; 4661 args["[MESSAGE]"] = message;
4633 if (strlen(first_name) > 0) 4662 if (strlen(first_name) > 0) /* Flawfinder: ignore */
4634 { 4663 {
4635 args["[FIRST]"] = first_name; 4664 args["[FIRST]"] = first_name;
4636 args["[LAST]"] = last_name; 4665 args["[LAST]"] = last_name;
@@ -4656,9 +4685,9 @@ struct LoadUrlInfo
4656 LLUUID mObjectID; 4685 LLUUID mObjectID;
4657 LLUUID mOwnerID; 4686 LLUUID mOwnerID;
4658 BOOL mOwnerIsGroup; 4687 BOOL mOwnerIsGroup;
4659 char mObjectName[256]; 4688 char mObjectName[256]; /* Flawfinder: ignore */
4660 char mMessage[256]; 4689 char mMessage[256]; /* Flawfinder: ignore */
4661 char mUrl[256]; 4690 char mUrl[256]; /* Flawfinder: ignore */
4662}; 4691};
4663 4692
4664std::vector<LoadUrlInfo*> gLoadUrlList; 4693std::vector<LoadUrlInfo*> gLoadUrlList;
@@ -4770,8 +4799,8 @@ void process_initiate_download(LLMessageSystem* msg, void**)
4770 return; 4799 return;
4771 } 4800 }
4772 4801
4773 char sim_filename[MAX_PATH]; 4802 char sim_filename[MAX_PATH]; /* Flawfinder: ignore */
4774 char viewer_filename[MAX_PATH]; 4803 char viewer_filename[MAX_PATH]; /* Flawfinder: ignore */
4775 msg->getString("FileData", "SimFilename", MAX_PATH, sim_filename); 4804 msg->getString("FileData", "SimFilename", MAX_PATH, sim_filename);
4776 msg->getString("FileData", "ViewerFilename", MAX_PATH, viewer_filename); 4805 msg->getString("FileData", "ViewerFilename", MAX_PATH, viewer_filename);
4777 4806
@@ -4787,8 +4816,8 @@ void process_initiate_download(LLMessageSystem* msg, void**)
4787 4816
4788void process_script_teleport_request(LLMessageSystem* msg, void**) 4817void process_script_teleport_request(LLMessageSystem* msg, void**)
4789{ 4818{
4790 char object_name[256]; 4819 char object_name[256]; /* Flawfinder: ignore */
4791 char sim_name[256]; 4820 char sim_name[256]; /* Flawfinder: ignore */
4792 LLVector3 pos; 4821 LLVector3 pos;
4793 LLVector3 look_at; 4822 LLVector3 look_at;
4794 4823
@@ -4804,7 +4833,7 @@ void process_script_teleport_request(LLMessageSystem* msg, void**)
4804void process_covenant_reply(LLMessageSystem* msg, void**) 4833void process_covenant_reply(LLMessageSystem* msg, void**)
4805{ 4834{
4806 LLUUID covenant_id, estate_owner_id; 4835 LLUUID covenant_id, estate_owner_id;
4807 char estate_name[MAX_STRING]; 4836 char estate_name[MAX_STRING]; /* Flawfinder: ignore */
4808 U32 covenant_timestamp; 4837 U32 covenant_timestamp;
4809 msg->getUUID("Data", "CovenantID", covenant_id); 4838 msg->getUUID("Data", "CovenantID", covenant_id);
4810 msg->getU32("Data", "CovenantTimestamp", covenant_timestamp); 4839 msg->getU32("Data", "CovenantTimestamp", covenant_timestamp);
@@ -4816,10 +4845,10 @@ void process_covenant_reply(LLMessageSystem* msg, void**)
4816 LLFloaterBuyLand::updateEstateName(estate_name); 4845 LLFloaterBuyLand::updateEstateName(estate_name);
4817 4846
4818 // standard message, not from system 4847 // standard message, not from system
4819 char last_modified[MAX_STRING]; 4848 char last_modified[MAX_STRING]; /* Flawfinder: ignore */
4820 last_modified[0] = '\0'; 4849 last_modified[0] = '\0';
4821 char time_buf[TIME_STR_LENGTH]; 4850 char time_buf[TIME_STR_LENGTH]; /* Flawfinder: ignore */
4822 sprintf(last_modified, "Last Modified %s", 4851 snprintf(last_modified, MAX_STRING, "Last Modified %s", /* Flawfinder: ignore */
4823 formatted_time((time_t)covenant_timestamp, time_buf)); 4852 formatted_time((time_t)covenant_timestamp, time_buf));
4824 4853
4825 LLPanelEstateCovenant::updateLastModified(last_modified); 4854 LLPanelEstateCovenant::updateLastModified(last_modified);
@@ -4898,7 +4927,13 @@ void onCovenantLoadComplete(LLVFS *vfs,
4898 S32 file_length = file.getSize(); 4927 S32 file_length = file.getSize();
4899 4928
4900 char* buffer = new char[file_length+1]; 4929 char* buffer = new char[file_length+1];
4901 file.read((U8*)buffer, file_length); 4930 if (buffer == NULL)
4931 {
4932 llerrs << "Memory Allocation failed" << llendl;
4933 return;
4934 }
4935
4936 file.read((U8*)buffer, file_length); /* Flawfinder: ignore */
4902 4937
4903 // put a EOS at the end 4938 // put a EOS at the end
4904 buffer[file_length] = 0; 4939 buffer[file_length] = 0;
@@ -5009,7 +5044,7 @@ void process_feature_disabled_message(LLMessageSystem* msg, void**)
5009 // Handle Blacklisted feature simulator response... 5044 // Handle Blacklisted feature simulator response...
5010 LLUUID agentID; 5045 LLUUID agentID;
5011 LLUUID transactionID; 5046 LLUUID transactionID;
5012 char messageText[MAX_STRING]; 5047 char messageText[MAX_STRING]; /* Flawfinder: ignore */
5013 msg->getStringFast(_PREHASH_FailureInfo,_PREHASH_ErrorMessage,MAX_STRING,&messageText[0],0); 5048 msg->getStringFast(_PREHASH_FailureInfo,_PREHASH_ErrorMessage,MAX_STRING,&messageText[0],0);
5014 msg->getUUIDFast(_PREHASH_FailureInfo,_PREHASH_AgentID,agentID); 5049 msg->getUUIDFast(_PREHASH_FailureInfo,_PREHASH_AgentID,agentID);
5015 msg->getUUIDFast(_PREHASH_FailureInfo,_PREHASH_TransactionID,transactionID); 5050 msg->getUUIDFast(_PREHASH_FailureInfo,_PREHASH_TransactionID,transactionID);