aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloaterregioninfo.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:44:50 -0500
committerJacek Antonelli2008-08-15 23:44:50 -0500
commit89fe5dab825a62a0e3fd8d248cbc91c65eb2a426 (patch)
treebcff14b7888d04a2fec799c59369f6095224bd08 /linden/indra/newview/llfloaterregioninfo.cpp
parentSecond Life viewer sources 1.13.3.2 (diff)
downloadmeta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.zip
meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.gz
meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.bz2
meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.xz
Second Life viewer sources 1.14.0.0
Diffstat (limited to 'linden/indra/newview/llfloaterregioninfo.cpp')
-rw-r--r--linden/indra/newview/llfloaterregioninfo.cpp141
1 files changed, 77 insertions, 64 deletions
diff --git a/linden/indra/newview/llfloaterregioninfo.cpp b/linden/indra/newview/llfloaterregioninfo.cpp
index 7fe6148..b758777 100644
--- a/linden/indra/newview/llfloaterregioninfo.cpp
+++ b/linden/indra/newview/llfloaterregioninfo.cpp
@@ -221,7 +221,7 @@ void LLFloaterRegionInfo::show(LLViewerRegion* region)
221 "EstateOwnerMessage", 221 "EstateOwnerMessage",
222 &processEstateOwnerRequest); 222 &processEstateOwnerRequest);
223 } 223 }
224 sInstance->open(); 224 sInstance->open(); /* Flawfinder: ignore*/
225 sInstance->refreshFromRegion(region); 225 sInstance->refreshFromRegion(region);
226 226
227 // Must allow anyone to request the RegionInfo data 227 // Must allow anyone to request the RegionInfo data
@@ -291,7 +291,7 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg)
291 if(!tab) return; 291 if(!tab) return;
292 292
293 // extract message 293 // extract message
294 char sim_name[MAX_STRING]; 294 char sim_name[MAX_STRING]; /* Flawfinder: ignore*/
295 U32 region_flags; 295 U32 region_flags;
296 U8 agent_limit; 296 U8 agent_limit;
297 F32 object_bonus_factor; 297 F32 object_bonus_factor;
@@ -324,12 +324,20 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg)
324 panel->childSetValue("restrict_pushobject", (region_flags & REGION_FLAGS_RESTRICT_PUSHOBJECT) ? TRUE : FALSE ); 324 panel->childSetValue("restrict_pushobject", (region_flags & REGION_FLAGS_RESTRICT_PUSHOBJECT) ? TRUE : FALSE );
325 panel->childSetValue("allow_land_resell_check", (region_flags & REGION_FLAGS_BLOCK_LAND_RESELL) ? FALSE : TRUE ); 325 panel->childSetValue("allow_land_resell_check", (region_flags & REGION_FLAGS_BLOCK_LAND_RESELL) ? FALSE : TRUE );
326 panel->childSetValue("allow_parcel_changes_check", (region_flags & REGION_FLAGS_ALLOW_PARCEL_CHANGES) ? TRUE : FALSE ); 326 panel->childSetValue("allow_parcel_changes_check", (region_flags & REGION_FLAGS_ALLOW_PARCEL_CHANGES) ? TRUE : FALSE );
327
328 panel->childSetValue("agent_limit_spin", LLSD((F32)agent_limit) ); 327 panel->childSetValue("agent_limit_spin", LLSD((F32)agent_limit) );
329 panel->childSetValue("object_bonus_spin", LLSD(object_bonus_factor) ); 328 panel->childSetValue("object_bonus_spin", LLSD(object_bonus_factor) );
330
331 panel->childSetValue("access_combo", LLSD(LLViewerRegion::accessToString(sim_access)) ); 329 panel->childSetValue("access_combo", LLSD(LLViewerRegion::accessToString(sim_access)) );
332 330
331
332 // detect teen grid for maturity
333 LLViewerRegion* region = gAgent.getRegion();
334
335 U32 parent_estate_id;
336 msg->getU32("RegionInfo", "ParentEstateID", parent_estate_id);
337 BOOL teen_grid = (parent_estate_id == 5); // *TODO add field to estate table and test that
338 panel->childSetEnabled("access_combo", gAgent.isGodlike() || (region && region->canManageEstate() && !teen_grid));
339
340
333 // DEBUG PANEL 341 // DEBUG PANEL
334 panel = LLUICtrlFactory::getPanelByName(tab, "Debug"); 342 panel = LLUICtrlFactory::getPanelByName(tab, "Debug");
335 if(!panel) return; 343 if(!panel) return;
@@ -349,7 +357,6 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg)
349 panel->childSetValue("terrain_lower_spin", LLSD(terrain_lower_limit)); 357 panel->childSetValue("terrain_lower_spin", LLSD(terrain_lower_limit));
350 panel->childSetValue("use_estate_sun_check", LLSD(use_estate_sun)); 358 panel->childSetValue("use_estate_sun_check", LLSD(use_estate_sun));
351 359
352 LLViewerRegion* region = gAgent.getRegion();
353 BOOL allow_modify = gAgent.isGodlike() || (region && region->canManageEstate()); 360 BOOL allow_modify = gAgent.isGodlike() || (region && region->canManageEstate());
354 panel->childSetValue("fixed_sun_check", LLSD((BOOL)(region_flags & REGION_FLAGS_SUN_FIXED))); 361 panel->childSetValue("fixed_sun_check", LLSD((BOOL)(region_flags & REGION_FLAGS_SUN_FIXED)));
355 panel->childSetEnabled("fixed_sun_check", allow_modify && !use_estate_sun); 362 panel->childSetEnabled("fixed_sun_check", allow_modify && !use_estate_sun);
@@ -525,7 +532,8 @@ bool LLPanelRegionGeneralInfo::refreshFromRegion(LLViewerRegion* region)
525 setCtrlsEnabled(allow_modify); 532 setCtrlsEnabled(allow_modify);
526 childDisable("apply_btn"); 533 childDisable("apply_btn");
527 childSetEnabled("access_text", allow_modify); 534 childSetEnabled("access_text", allow_modify);
528 childSetEnabled("access_combo", allow_modify); 535 // childSetEnabled("access_combo", allow_modify);
536 // now set in processRegionInfo for teen grid detection
529 childSetEnabled("kick_btn", allow_modify); 537 childSetEnabled("kick_btn", allow_modify);
530 childSetEnabled("kick_all_btn", allow_modify); 538 childSetEnabled("kick_all_btn", allow_modify);
531 childSetEnabled("im_btn", allow_modify); 539 childSetEnabled("im_btn", allow_modify);
@@ -591,7 +599,7 @@ void LLPanelRegionGeneralInfo::onKickCommit(const std::vector<std::string>& name
591 strings_t strings; 599 strings_t strings;
592 // [0] = our agent id 600 // [0] = our agent id
593 // [1] = target agent id 601 // [1] = target agent id
594 char buffer[MAX_STRING]; 602 char buffer[MAX_STRING]; /* Flawfinder: ignore*/
595 gAgent.getID().toString(buffer); 603 gAgent.getID().toString(buffer);
596 strings.push_back(buffer); 604 strings.push_back(buffer);
597 605
@@ -619,7 +627,7 @@ void LLPanelRegionGeneralInfo::onKickAllCommit(S32 option, void* userdata)
619 if(!self) return; 627 if(!self) return;
620 strings_t strings; 628 strings_t strings;
621 // [0] = our agent id 629 // [0] = our agent id
622 char buffer[MAX_STRING]; 630 char buffer[MAX_STRING]; /* Flawfinder: ignore*/
623 gAgent.getID().toString(buffer); 631 gAgent.getID().toString(buffer);
624 strings.push_back(buffer); 632 strings.push_back(buffer);
625 633
@@ -654,7 +662,7 @@ void LLPanelRegionGeneralInfo::onMessageCommit(S32 option, const LLString& text,
654 // [4] message 662 // [4] message
655 strings.push_back("-1"); 663 strings.push_back("-1");
656 strings.push_back("-1"); 664 strings.push_back("-1");
657 char buffer[MAX_STRING]; 665 char buffer[MAX_STRING]; /* Flawfinder: ignore*/
658 gAgent.getID().toString(buffer); 666 gAgent.getID().toString(buffer);
659 strings.push_back(buffer); 667 strings.push_back(buffer);
660 std::string name; 668 std::string name;
@@ -688,35 +696,35 @@ BOOL LLPanelRegionGeneralInfo::sendUpdate()
688 llinfos << "LLPanelRegionGeneralInfo::sendUpdate()" << llendl; 696 llinfos << "LLPanelRegionGeneralInfo::sendUpdate()" << llendl;
689 strings_t strings; 697 strings_t strings;
690 //integers_t integers; 698 //integers_t integers;
691 char buffer[MAX_STRING]; 699 char buffer[MAX_STRING]; /* Flawfinder: ignore*/
692 sprintf(buffer, "%s", (childGetValue("block_terraform_check").asBoolean() ? "Y" : "N")); 700 snprintf(buffer, MAX_STRING, "%s", (childGetValue("block_terraform_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */
693 strings.push_back(strings_t::value_type(buffer)); 701 strings.push_back(strings_t::value_type(buffer));
694 702
695 sprintf(buffer, "%s", (childGetValue("block_fly_check").asBoolean() ? "Y" : "N")); 703 snprintf(buffer, MAX_STRING, "%s", (childGetValue("block_fly_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */
696 strings.push_back(strings_t::value_type(buffer)); 704 strings.push_back(strings_t::value_type(buffer));
697 705
698 sprintf(buffer, "%s", (childGetValue("allow_damage_check").asBoolean() ? "Y" : "N")); 706 snprintf(buffer, MAX_STRING, "%s", (childGetValue("allow_damage_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */
699 strings.push_back(strings_t::value_type(buffer)); 707 strings.push_back(strings_t::value_type(buffer));
700 708
701 sprintf(buffer, "%s", (childGetValue("allow_land_resell_check").asBoolean() ? "Y" : "N")); 709 snprintf(buffer, MAX_STRING, "%s", (childGetValue("allow_land_resell_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */
702 strings.push_back(strings_t::value_type(buffer)); 710 strings.push_back(strings_t::value_type(buffer));
703 711
704 F32 value = (F32)childGetValue("agent_limit_spin").asReal(); 712 F32 value = (F32)childGetValue("agent_limit_spin").asReal();
705 sprintf(buffer, "%f", value); 713 snprintf(buffer, MAX_STRING, "%f", value); /* Flawfinder: ignore*/
706 strings.push_back(strings_t::value_type(buffer)); 714 strings.push_back(strings_t::value_type(buffer));
707 715
708 value = (F32)childGetValue("object_bonus_spin").asReal(); 716 value = (F32)childGetValue("object_bonus_spin").asReal();
709 sprintf(buffer, "%f", value); 717 snprintf(buffer, MAX_STRING, "%f", value); /* Flawfinder: ignore*/
710 strings.push_back(strings_t::value_type(buffer)); 718 strings.push_back(strings_t::value_type(buffer));
711 719
712 U8 access = LLViewerRegion::stringToAccess(childGetValue("access_combo").asString().c_str()); 720 U8 access = LLViewerRegion::stringToAccess(childGetValue("access_combo").asString().c_str());
713 sprintf(buffer, "%d", (S32)access); 721 snprintf(buffer, MAX_STRING, "%d", (S32)access); /* Flawfinder: ignore */
714 strings.push_back(strings_t::value_type(buffer)); 722 strings.push_back(strings_t::value_type(buffer));
715 723
716 sprintf(buffer, "%s", (childGetValue("restrict_pushobject").asBoolean() ? "Y" : "N")); 724 snprintf(buffer, MAX_STRING, "%s", (childGetValue("restrict_pushobject").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */
717 strings.push_back(strings_t::value_type(buffer)); 725 strings.push_back(strings_t::value_type(buffer));
718 726
719 sprintf(buffer, "%s", (childGetValue("allow_parcel_changes_check").asBoolean() ? "Y" : "N")); 727 snprintf(buffer, MAX_STRING, "%s", (childGetValue("allow_parcel_changes_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */
720 strings.push_back(strings_t::value_type(buffer)); 728 strings.push_back(strings_t::value_type(buffer));
721 729
722 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); 730 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
@@ -724,7 +732,7 @@ BOOL LLPanelRegionGeneralInfo::sendUpdate()
724 732
725 LLViewerRegion* region = gAgent.getRegion(); 733 LLViewerRegion* region = gAgent.getRegion();
726 if (region 734 if (region
727 && access != region->getSimAccess() ) 735 && access != region->getSimAccess() ) /* Flawfinder: ignore */
728 { 736 {
729 gViewerWindow->alertXml("RegionMaturityChange"); 737 gViewerWindow->alertXml("RegionMaturityChange");
730 } 738 }
@@ -783,15 +791,15 @@ BOOL LLPanelRegionDebugInfo::sendUpdate()
783{ 791{
784 llinfos << "LLPanelRegionDebugInfo::sendUpdate" << llendl; 792 llinfos << "LLPanelRegionDebugInfo::sendUpdate" << llendl;
785 strings_t strings; 793 strings_t strings;
786 char buffer[MAX_STRING]; 794 char buffer[MAX_STRING]; /* Flawfinder: ignore */
787 795
788 sprintf(buffer, "%s", (childGetValue("disable_scripts_check").asBoolean() ? "Y" : "N")); 796 snprintf(buffer, MAX_STRING, "%s", (childGetValue("disable_scripts_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */
789 strings.push_back(buffer); 797 strings.push_back(buffer);
790 798
791 sprintf(buffer, "%s", (childGetValue("disable_collisions_check").asBoolean() ? "Y" : "N")); 799 snprintf(buffer, MAX_STRING, "%s", (childGetValue("disable_collisions_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */
792 strings.push_back(buffer); 800 strings.push_back(buffer);
793 801
794 sprintf(buffer, "%s", (childGetValue("disable_physics_check").asBoolean() ? "Y" : "N")); 802 snprintf(buffer, MAX_STRING, "%s", (childGetValue("disable_physics_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */
795 strings.push_back(buffer); 803 strings.push_back(buffer);
796 804
797 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); 805 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
@@ -946,10 +954,10 @@ bool LLPanelRegionTextureInfo::refreshFromRegion(LLViewerRegion* region)
946 954
947 LLVLComposition* compp = region->getComposition(); 955 LLVLComposition* compp = region->getComposition();
948 LLTextureCtrl* texture_ctrl; 956 LLTextureCtrl* texture_ctrl;
949 char buffer[MAX_STRING]; 957 char buffer[MAX_STRING]; /* Flawfinder: ignore */
950 for(S32 i = 0; i < TERRAIN_TEXTURE_COUNT; ++i) 958 for(S32 i = 0; i < TERRAIN_TEXTURE_COUNT; ++i)
951 { 959 {
952 sprintf(buffer, "texture_detail_%d", i); 960 snprintf(buffer, MAX_STRING, "texture_detail_%d", i); /* Flawfinder: ignore */
953 texture_ctrl = LLViewerUICtrlFactory::getTexturePickerByName(this, buffer); 961 texture_ctrl = LLViewerUICtrlFactory::getTexturePickerByName(this, buffer);
954 if(texture_ctrl) 962 if(texture_ctrl)
955 { 963 {
@@ -962,9 +970,9 @@ bool LLPanelRegionTextureInfo::refreshFromRegion(LLViewerRegion* region)
962 970
963 for(S32 i = 0; i < CORNER_COUNT; ++i) 971 for(S32 i = 0; i < CORNER_COUNT; ++i)
964 { 972 {
965 sprintf(buffer, "height_start_spin_%d", i); 973 snprintf(buffer, MAX_STRING, "height_start_spin_%d", i); /* Flawfinder: ignore */
966 childSetValue(buffer, LLSD(compp->getStartHeight(i))); 974 childSetValue(buffer, LLSD(compp->getStartHeight(i)));
967 sprintf(buffer, "height_range_spin_%d", i); 975 snprintf(buffer, MAX_STRING, "height_range_spin_%d", i); /* Flawfinder: ignore */
968 childSetValue(buffer, LLSD(compp->getHeightRange(i))); 976 childSetValue(buffer, LLSD(compp->getHeightRange(i)));
969 } 977 }
970 978
@@ -976,18 +984,18 @@ bool LLPanelRegionTextureInfo::refreshFromRegion(LLViewerRegion* region)
976BOOL LLPanelRegionTextureInfo::postBuild() 984BOOL LLPanelRegionTextureInfo::postBuild()
977{ 985{
978 LLPanelRegionInfo::postBuild(); 986 LLPanelRegionInfo::postBuild();
979 char buffer[MAX_STRING]; 987 char buffer[MAX_STRING]; /* Flawfinder: ignore */
980 for(S32 i = 0; i < TERRAIN_TEXTURE_COUNT; ++i) 988 for(S32 i = 0; i < TERRAIN_TEXTURE_COUNT; ++i)
981 { 989 {
982 sprintf(buffer, "texture_detail_%d", i); 990 snprintf(buffer, MAX_STRING, "texture_detail_%d", i); /* Flawfinder: ignore */
983 initCtrl(buffer); 991 initCtrl(buffer);
984 } 992 }
985 993
986 for(S32 i = 0; i < CORNER_COUNT; ++i) 994 for(S32 i = 0; i < CORNER_COUNT; ++i)
987 { 995 {
988 sprintf(buffer, "height_start_spin_%d", i); 996 snprintf(buffer, MAX_STRING, "height_start_spin_%d", i); /* Flawfinder: ignore */
989 initCtrl(buffer); 997 initCtrl(buffer);
990 sprintf(buffer, "height_range_spin_%d", i); 998 snprintf(buffer, MAX_STRING, "height_range_spin_%d", i); /* Flawfinder: ignore */
991 initCtrl(buffer); 999 initCtrl(buffer);
992 } 1000 }
993 1001
@@ -1017,9 +1025,9 @@ BOOL LLPanelRegionTextureInfo::sendUpdate()
1017 } 1025 }
1018 1026
1019 LLTextureCtrl* texture_ctrl; 1027 LLTextureCtrl* texture_ctrl;
1020 char buffer[MAX_STRING]; 1028 char buffer[MAX_STRING]; /* Flawfinder: ignore */
1021 char buffer2[MAX_STRING]; 1029 char buffer2[MAX_STRING]; /* Flawfinder: ignore */
1022 char id_str[UUID_STR_LENGTH]; 1030 char id_str[UUID_STR_LENGTH]; /* Flawfinder: ignore */
1023 LLMessageSystem* msg = gMessageSystem; 1031 LLMessageSystem* msg = gMessageSystem;
1024 strings_t strings; 1032 strings_t strings;
1025 1033
@@ -1027,13 +1035,13 @@ BOOL LLPanelRegionTextureInfo::sendUpdate()
1027 1035
1028 for(S32 i = 0; i < TERRAIN_TEXTURE_COUNT; ++i) 1036 for(S32 i = 0; i < TERRAIN_TEXTURE_COUNT; ++i)
1029 { 1037 {
1030 sprintf(buffer, "texture_detail_%d", i); 1038 snprintf(buffer, MAX_STRING, "texture_detail_%d", i); /* Flawfinder: ignore */
1031 texture_ctrl = LLViewerUICtrlFactory::getTexturePickerByName(this, buffer); 1039 texture_ctrl = LLViewerUICtrlFactory::getTexturePickerByName(this, buffer);
1032 if(texture_ctrl) 1040 if(texture_ctrl)
1033 { 1041 {
1034 LLUUID tmp_id(texture_ctrl->getImageAssetID()); 1042 LLUUID tmp_id(texture_ctrl->getImageAssetID());
1035 tmp_id.toString(id_str); 1043 tmp_id.toString(id_str);
1036 sprintf(buffer, "%d %s", i, id_str); 1044 snprintf(buffer, MAX_STRING, "%d %s", i, id_str); /* Flawfinder: ignore */
1037 strings.push_back(strings_t::value_type(buffer)); 1045 strings.push_back(strings_t::value_type(buffer));
1038 } 1046 }
1039 } 1047 }
@@ -1041,9 +1049,9 @@ BOOL LLPanelRegionTextureInfo::sendUpdate()
1041 strings.clear(); 1049 strings.clear();
1042 for(S32 i = 0; i < CORNER_COUNT; ++i) 1050 for(S32 i = 0; i < CORNER_COUNT; ++i)
1043 { 1051 {
1044 sprintf(buffer, "height_start_spin_%d", i); 1052 snprintf(buffer, MAX_STRING, "height_start_spin_%d", i); /* Flawfinder: ignore */
1045 sprintf(buffer2, "height_range_spin_%d", i); 1053 snprintf(buffer2, MAX_STRING, "height_range_spin_%d", i); /* Flawfinder: ignore */
1046 sprintf(buffer, "%d %f %f", i, (F32)childGetValue(buffer).asReal(), (F32)childGetValue(buffer2).asReal()); 1054 snprintf(buffer, MAX_STRING, "%d %f %f", i, (F32)childGetValue(buffer).asReal(), (F32)childGetValue(buffer2).asReal()); /* Flawfinder: ignore */
1047 strings.push_back(strings_t::value_type(buffer)); 1055 strings.push_back(strings_t::value_type(buffer));
1048 } 1056 }
1049 sendEstateOwnerMessage(msg, "textureheights", invoice, strings); 1057 sendEstateOwnerMessage(msg, "textureheights", invoice, strings);
@@ -1056,8 +1064,8 @@ BOOL LLPanelRegionTextureInfo::validateTextureSizes()
1056{ 1064{
1057 for(S32 i = 0; i < TERRAIN_TEXTURE_COUNT; ++i) 1065 for(S32 i = 0; i < TERRAIN_TEXTURE_COUNT; ++i)
1058 { 1066 {
1059 char buffer[MAX_STRING]; 1067 char buffer[MAX_STRING]; /* Flawfinder: ignore */
1060 sprintf(buffer, "texture_detail_%d", i); 1068 snprintf(buffer, MAX_STRING, "texture_detail_%d", i); /* Flawfinder: ignore */
1061 LLTextureCtrl* texture_ctrl = LLViewerUICtrlFactory::getTexturePickerByName(this, buffer); 1069 LLTextureCtrl* texture_ctrl = LLViewerUICtrlFactory::getTexturePickerByName(this, buffer);
1062 if (!texture_ctrl) continue; 1070 if (!texture_ctrl) continue;
1063 1071
@@ -1158,21 +1166,21 @@ bool LLPanelRegionTerrainInfo::refreshFromRegion(LLViewerRegion* region)
1158BOOL LLPanelRegionTerrainInfo::sendUpdate() 1166BOOL LLPanelRegionTerrainInfo::sendUpdate()
1159{ 1167{
1160 llinfos << "LLPanelRegionTerrainInfo::sendUpdate" << llendl; 1168 llinfos << "LLPanelRegionTerrainInfo::sendUpdate" << llendl;
1161 char buffer[MAX_STRING]; 1169 char buffer[MAX_STRING]; /* Flawfinder: ignore */
1162 strings_t strings; 1170 strings_t strings;
1163 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); 1171 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
1164 1172
1165 sprintf(buffer, "%f", (F32)childGetValue("water_height_spin").asReal()); 1173 snprintf(buffer, MAX_STRING, "%f", (F32)childGetValue("water_height_spin").asReal()); /* Flawfinder: ignore */
1166 strings.push_back(buffer); 1174 strings.push_back(buffer);
1167 sprintf(buffer, "%f", (F32)childGetValue("terrain_raise_spin").asReal()); 1175 snprintf(buffer, MAX_STRING, "%f", (F32)childGetValue("terrain_raise_spin").asReal()); /* Flawfinder: ignore */
1168 strings.push_back(buffer); 1176 strings.push_back(buffer);
1169 sprintf(buffer, "%f", (F32)childGetValue("terrain_lower_spin").asReal()); 1177 snprintf(buffer, MAX_STRING, "%f", (F32)childGetValue("terrain_lower_spin").asReal()); /* Flawfinder: ignore */
1170 strings.push_back(buffer); 1178 strings.push_back(buffer);
1171 sprintf(buffer, "%s", (childGetValue("use_estate_sun_check").asBoolean() ? "Y" : "N")); 1179 snprintf(buffer, MAX_STRING, "%s", (childGetValue("use_estate_sun_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore*/
1172 strings.push_back(buffer); 1180 strings.push_back(buffer);
1173 sprintf(buffer, "%s", (childGetValue("fixed_sun_check").asBoolean() ? "Y" : "N")); 1181 snprintf(buffer, MAX_STRING, "%s", (childGetValue("fixed_sun_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore*/
1174 strings.push_back(buffer); 1182 strings.push_back(buffer);
1175 sprintf(buffer, "%f", (F32)childGetValue("sun_hour_slider").asReal() ); 1183 snprintf(buffer, MAX_STRING, "%f", (F32)childGetValue("sun_hour_slider").asReal() ); /* Flawfinder: ignore*/
1176 strings.push_back(buffer); 1184 strings.push_back(buffer);
1177 1185
1178 // Grab estate information in case the user decided to set the 1186 // Grab estate information in case the user decided to set the
@@ -1198,11 +1206,11 @@ BOOL LLPanelRegionTerrainInfo::sendUpdate()
1198 estate_sun_hour = panel->getSunHour(); 1206 estate_sun_hour = panel->getSunHour();
1199 } 1207 }
1200 1208
1201 sprintf(buffer, "%s", (estate_global_time ? "Y" : "N") ); 1209 snprintf(buffer, MAX_STRING, "%s", (estate_global_time ? "Y" : "N") ); /* Flawfinder: ignore*/
1202 strings.push_back(buffer); 1210 strings.push_back(buffer);
1203 sprintf(buffer, "%s", (estate_fixed_sun ? "Y" : "N") ); 1211 snprintf(buffer, MAX_STRING, "%s", (estate_fixed_sun ? "Y" : "N") ); /* Flawfinder: ignore*/
1204 strings.push_back(buffer); 1212 strings.push_back(buffer);
1205 sprintf(buffer, "%f", estate_sun_hour); 1213 snprintf(buffer, MAX_STRING, "%f", estate_sun_hour); /* Flawfinder: ignore*/
1206 strings.push_back(buffer); 1214 strings.push_back(buffer);
1207 1215
1208 sendEstateOwnerMessage(gMessageSystem, "setregionterrain", invoice, strings); 1216 sendEstateOwnerMessage(gMessageSystem, "setregionterrain", invoice, strings);
@@ -1531,7 +1539,7 @@ void LLPanelEstateInfo::kickUserConfirm(S32 option, void* userdata)
1531 1539
1532 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); 1540 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
1533 strings_t strings; 1541 strings_t strings;
1534 char buffer[MAX_STRING]; 1542 char buffer[MAX_STRING]; /* Flawfinder: ignore*/
1535 1543
1536 switch(option) 1544 switch(option)
1537 { 1545 {
@@ -1814,12 +1822,12 @@ void LLPanelEstateInfo::sendEstateAccessDelta(U32 flags, const LLUUID& agent_or_
1814 msg->addString("Method", "estateaccessdelta"); 1822 msg->addString("Method", "estateaccessdelta");
1815 msg->addUUID("Invoice", LLFloaterRegionInfo::getLastInvoice()); 1823 msg->addUUID("Invoice", LLFloaterRegionInfo::getLastInvoice());
1816 1824
1817 char buf[MAX_STRING]; 1825 char buf[MAX_STRING]; /* Flawfinder: ignore*/
1818 gAgent.getID().toString(buf); 1826 gAgent.getID().toString(buf);
1819 msg->nextBlock("ParamList"); 1827 msg->nextBlock("ParamList");
1820 msg->addString("Parameter", buf); 1828 msg->addString("Parameter", buf);
1821 1829
1822 sprintf(buf, "%u", flags); 1830 snprintf(buf, MAX_STRING, "%u", flags); /* Flawfinder: ignore*/
1823 msg->nextBlock("ParamList"); 1831 msg->nextBlock("ParamList");
1824 msg->addString("Parameter", buf); 1832 msg->addString("Parameter", buf);
1825 1833
@@ -2075,8 +2083,8 @@ void LLPanelEstateInfo::commitEstateInfo()
2075 msg->nextBlock("ParamList"); 2083 msg->nextBlock("ParamList");
2076 msg->addString("Parameter", getEstateName()); 2084 msg->addString("Parameter", getEstateName());
2077 2085
2078 char buf[MAX_STRING]; 2086 char buf[MAX_STRING]; /* Flawfinder: ignore*/
2079 sprintf(buf, "%u", computeEstateFlags()); 2087 snprintf(buf, MAX_STRING, "%u", computeEstateFlags()); /* Flawfinder: ignore*/
2080 msg->nextBlock("ParamList"); 2088 msg->nextBlock("ParamList");
2081 msg->addString("Parameter", buf); 2089 msg->addString("Parameter", buf);
2082 2090
@@ -2086,7 +2094,7 @@ void LLPanelEstateInfo::commitEstateInfo()
2086 sun_hour = 0.f; // 0 = global time 2094 sun_hour = 0.f; // 0 = global time
2087 } 2095 }
2088 2096
2089 sprintf(buf, "%d", (S32)(sun_hour*1024.0f)); 2097 snprintf(buf, MAX_STRING, "%d", (S32)(sun_hour*1024.0f)); /* Flawfinder: ignore*/
2090 msg->nextBlock("ParamList"); 2098 msg->nextBlock("ParamList");
2091 msg->addString("Parameter", buf); 2099 msg->addString("Parameter", buf);
2092 2100
@@ -2560,8 +2568,13 @@ void LLPanelEstateCovenant::onLoadComplete(LLVFS *vfs,
2560 S32 file_length = file.getSize(); 2568 S32 file_length = file.getSize();
2561 2569
2562 char* buffer = new char[file_length+1]; 2570 char* buffer = new char[file_length+1];
2563 file.read((U8*)buffer, file_length); 2571 if (buffer == NULL)
2572 {
2573 llerrs << "Memory Allocation Failed" << llendl;
2574 return;
2575 }
2564 2576
2577 file.read((U8*)buffer, file_length); /* Flawfinder: ignore */
2565 // put a EOS at the end 2578 // put a EOS at the end
2566 buffer[file_length] = 0; 2579 buffer[file_length] = 0;
2567 2580
@@ -2633,7 +2646,7 @@ void LLPanelEstateCovenant::sendChangeCovenantID(const LLUUID &asset_id)
2633 msg->addUUID("Invoice", LLFloaterRegionInfo::getLastInvoice()); 2646 msg->addUUID("Invoice", LLFloaterRegionInfo::getLastInvoice());
2634 2647
2635 msg->nextBlock("ParamList"); 2648 msg->nextBlock("ParamList");
2636 msg->addString("Parameter", getCovenantID().getString().c_str()); 2649 msg->addString("Parameter", getCovenantID().asString());
2637 gAgent.sendReliableMessage(); 2650 gAgent.sendReliableMessage();
2638 } 2651 }
2639} 2652}
@@ -2879,7 +2892,7 @@ bool LLDispatchSetEstateAccess::operator()(
2879 for (S32 i = 0; i < num_allowed_agents && i < ESTATE_MAX_ACCESS_IDS; i++) 2892 for (S32 i = 0; i < num_allowed_agents && i < ESTATE_MAX_ACCESS_IDS; i++)
2880 { 2893 {
2881 LLUUID id; 2894 LLUUID id;
2882 memcpy(id.mData, strings[index++].data(), UUID_BYTES); 2895 memcpy(id.mData, strings[index++].data(), UUID_BYTES); /* Flawfinder: ignore */
2883 allowed_agent_name_list->addNameItem(id); 2896 allowed_agent_name_list->addNameItem(id);
2884 } 2897 }
2885 panel->childSetEnabled("remove_allowed_avatar_btn", allowed_agent_name_list->getFirstSelected() ? TRUE : FALSE); 2898 panel->childSetEnabled("remove_allowed_avatar_btn", allowed_agent_name_list->getFirstSelected() ? TRUE : FALSE);
@@ -2903,7 +2916,7 @@ bool LLDispatchSetEstateAccess::operator()(
2903 for (S32 i = 0; i < num_allowed_groups && i < ESTATE_MAX_GROUP_IDS; i++) 2916 for (S32 i = 0; i < num_allowed_groups && i < ESTATE_MAX_GROUP_IDS; i++)
2904 { 2917 {
2905 LLUUID id; 2918 LLUUID id;
2906 memcpy(id.mData, strings[index++].data(), UUID_BYTES); 2919 memcpy(id.mData, strings[index++].data(), UUID_BYTES); /* Flawfinder: ignore */
2907 allowed_group_name_list->addGroupNameItem(id); 2920 allowed_group_name_list->addGroupNameItem(id);
2908 } 2921 }
2909 panel->childSetEnabled("remove_allowed_group_btn", allowed_group_name_list->getFirstSelected() ? TRUE : FALSE); 2922 panel->childSetEnabled("remove_allowed_group_btn", allowed_group_name_list->getFirstSelected() ? TRUE : FALSE);
@@ -2935,7 +2948,7 @@ bool LLDispatchSetEstateAccess::operator()(
2935 for (S32 i = 0; i < num_banned_agents && i < ESTATE_MAX_ACCESS_IDS; i++) 2948 for (S32 i = 0; i < num_banned_agents && i < ESTATE_MAX_ACCESS_IDS; i++)
2936 { 2949 {
2937 LLUUID id; 2950 LLUUID id;
2938 memcpy(id.mData, strings[index++].data(), UUID_BYTES); 2951 memcpy(id.mData, strings[index++].data(), UUID_BYTES); /* Flawfinder: ignore */
2939 banned_agent_name_list->addNameItem(id); 2952 banned_agent_name_list->addNameItem(id);
2940 } 2953 }
2941 panel->childSetEnabled("remove_banned_avatar_btn", banned_agent_name_list->getFirstSelected() ? TRUE : FALSE); 2954 panel->childSetEnabled("remove_banned_avatar_btn", banned_agent_name_list->getFirstSelected() ? TRUE : FALSE);
@@ -2958,7 +2971,7 @@ bool LLDispatchSetEstateAccess::operator()(
2958 for (S32 i = 0; i < num_estate_managers && i < ESTATE_MAX_MANAGERS; i++) 2971 for (S32 i = 0; i < num_estate_managers && i < ESTATE_MAX_MANAGERS; i++)
2959 { 2972 {
2960 LLUUID id; 2973 LLUUID id;
2961 memcpy(id.mData, strings[index++].data(), UUID_BYTES); 2974 memcpy(id.mData, strings[index++].data(), UUID_BYTES); /* Flawfinder: ignore */
2962 estate_manager_name_list->addNameItem(id); 2975 estate_manager_name_list->addNameItem(id);
2963 } 2976 }
2964 panel->childSetEnabled("remove_estate_manager_btn", estate_manager_name_list->getFirstSelected() ? TRUE : FALSE); 2977 panel->childSetEnabled("remove_estate_manager_btn", estate_manager_name_list->getFirstSelected() ? TRUE : FALSE);