diff options
author | Jacek Antonelli | 2008-08-15 23:45:34 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:34 -0500 |
commit | cd17687f01420952712a500107e0f93e7ab8d5f8 (patch) | |
tree | ce48c2b706f2c1176290e39fb555fbdf6648ce01 /linden/indra/newview/llcallingcard.cpp | |
parent | Second Life viewer sources 1.19.0.5 (diff) | |
download | meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.zip meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.gz meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.bz2 meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.xz |
Second Life viewer sources 1.19.1.0
Diffstat (limited to 'linden/indra/newview/llcallingcard.cpp')
-rw-r--r-- | linden/indra/newview/llcallingcard.cpp | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/linden/indra/newview/llcallingcard.cpp b/linden/indra/newview/llcallingcard.cpp index 38d9beb..86e0bfb 100644 --- a/linden/indra/newview/llcallingcard.cpp +++ b/linden/indra/newview/llcallingcard.cpp | |||
@@ -193,7 +193,7 @@ bool LLAvatarTracker::haveTrackingInfo() | |||
193 | 193 | ||
194 | LLVector3d LLAvatarTracker::getGlobalPos() | 194 | LLVector3d LLAvatarTracker::getGlobalPos() |
195 | { | 195 | { |
196 | if(!mTrackedAgentValid) return LLVector3d(); | 196 | if(!mTrackedAgentValid || !mTrackingData) return LLVector3d(); |
197 | LLVector3d global_pos; | 197 | LLVector3d global_pos; |
198 | 198 | ||
199 | LLViewerObject* object = gObjectList.findObject(mTrackingData->mAvatarID); | 199 | LLViewerObject* object = gObjectList.findObject(mTrackingData->mAvatarID); |
@@ -266,9 +266,8 @@ S32 LLAvatarTracker::addBuddyList(const LLAvatarTracker::buddy_map_t& buds) | |||
266 | { | 266 | { |
267 | using namespace std; | 267 | using namespace std; |
268 | 268 | ||
269 | U32 new_buddy_count = 0; | 269 | U32 new_buddy_count = 0; |
270 | char first[DB_FIRST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/ | 270 | std::string first,last; |
271 | char last[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/ | ||
272 | LLUUID agent_id; | 271 | LLUUID agent_id; |
273 | for(buddy_map_t::const_iterator itr = buds.begin(); itr != buds.end(); ++itr) | 272 | for(buddy_map_t::const_iterator itr = buds.begin(); itr != buds.end(); ++itr) |
274 | { | 273 | { |
@@ -453,8 +452,10 @@ void LLAvatarTracker::empowerList(const buddy_map_t& list, bool grant) | |||
453 | 452 | ||
454 | void LLAvatarTracker::deleteTrackingData() | 453 | void LLAvatarTracker::deleteTrackingData() |
455 | { | 454 | { |
456 | delete mTrackingData; | 455 | //make sure mTrackingData never points to freed memory |
456 | LLTrackingData* tmp = mTrackingData; | ||
457 | mTrackingData = NULL; | 457 | mTrackingData = NULL; |
458 | delete tmp; | ||
458 | } | 459 | } |
459 | 460 | ||
460 | void LLAvatarTracker::findAgent() | 461 | void LLAvatarTracker::findAgent() |
@@ -588,8 +589,7 @@ void LLAvatarTracker::processChange(LLMessageSystem* msg) | |||
588 | { | 589 | { |
589 | if((mBuddyInfo[agent_id]->getRightsGrantedFrom() ^ new_rights) & LLRelationship::GRANT_MODIFY_OBJECTS) | 590 | if((mBuddyInfo[agent_id]->getRightsGrantedFrom() ^ new_rights) & LLRelationship::GRANT_MODIFY_OBJECTS) |
590 | { | 591 | { |
591 | char first[DB_FIRST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/ | 592 | std::string first, last; |
592 | char last[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/ | ||
593 | LLStringBase<char>::format_map_t args; | 593 | LLStringBase<char>::format_map_t args; |
594 | if(gCacheName->getName(agent_id, first, last)) | 594 | if(gCacheName->getName(agent_id, first, last)) |
595 | { | 595 | { |
@@ -646,8 +646,7 @@ void LLAvatarTracker::processNotify(LLMessageSystem* msg, bool online) | |||
646 | setBuddyOnline(agent_id,online); | 646 | setBuddyOnline(agent_id,online); |
647 | if(chat_notify) | 647 | if(chat_notify) |
648 | { | 648 | { |
649 | char first[DB_FIRST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/ | 649 | std::string first, last; |
650 | char last[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/ | ||
651 | if(gCacheName->getName(agent_id, first, last)) | 650 | if(gCacheName->getName(agent_id, first, last)) |
652 | { | 651 | { |
653 | notify = TRUE; | 652 | notify = TRUE; |
@@ -801,8 +800,6 @@ bool LLCollectProxyBuddies::operator()(const LLUUID& buddy_id, LLRelationship* b | |||
801 | 800 | ||
802 | bool LLCollectMappableBuddies::operator()(const LLUUID& buddy_id, LLRelationship* buddy) | 801 | bool LLCollectMappableBuddies::operator()(const LLUUID& buddy_id, LLRelationship* buddy) |
803 | { | 802 | { |
804 | mFirst[0] = '\0'; | ||
805 | mLast[0] = '\0'; | ||
806 | gCacheName->getName(buddy_id, mFirst, mLast); | 803 | gCacheName->getName(buddy_id, mFirst, mLast); |
807 | std::ostringstream fullname; | 804 | std::ostringstream fullname; |
808 | fullname << mFirst << " " << mLast; | 805 | fullname << mFirst << " " << mLast; |
@@ -816,8 +813,6 @@ bool LLCollectMappableBuddies::operator()(const LLUUID& buddy_id, LLRelationship | |||
816 | 813 | ||
817 | bool LLCollectOnlineBuddies::operator()(const LLUUID& buddy_id, LLRelationship* buddy) | 814 | bool LLCollectOnlineBuddies::operator()(const LLUUID& buddy_id, LLRelationship* buddy) |
818 | { | 815 | { |
819 | mFirst[0] = '\0'; | ||
820 | mLast[0] = '\0'; | ||
821 | gCacheName->getName(buddy_id, mFirst, mLast); | 816 | gCacheName->getName(buddy_id, mFirst, mLast); |
822 | std::ostringstream fullname; | 817 | std::ostringstream fullname; |
823 | fullname << mFirst << " " << mLast; | 818 | fullname << mFirst << " " << mLast; |
@@ -831,8 +826,6 @@ bool LLCollectOnlineBuddies::operator()(const LLUUID& buddy_id, LLRelationship* | |||
831 | 826 | ||
832 | bool LLCollectAllBuddies::operator()(const LLUUID& buddy_id, LLRelationship* buddy) | 827 | bool LLCollectAllBuddies::operator()(const LLUUID& buddy_id, LLRelationship* buddy) |
833 | { | 828 | { |
834 | mFirst[0] = '\0'; | ||
835 | mLast[0] = '\0'; | ||
836 | gCacheName->getName(buddy_id, mFirst, mLast); | 829 | gCacheName->getName(buddy_id, mFirst, mLast); |
837 | std::ostringstream fullname; | 830 | std::ostringstream fullname; |
838 | fullname << mFirst << " " << mLast; | 831 | fullname << mFirst << " " << mLast; |