diff options
author | Justin Clark-Casey (justincc) | 2011-11-14 16:06:06 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-11-14 16:06:06 +0000 |
commit | ff36a1bc7bcd1d0fe5aecb4c5358dbb072c7ff6e (patch) | |
tree | 236dd34deb3a8cc1259dcd37a51f5f88d8d79a22 /OpenSim/Region | |
parent | Do a ScenePresence null check in HGMessageTransferModule.SendIMToScene() to s... (diff) | |
download | opensim-SC_OLD-ff36a1bc7bcd1d0fe5aecb4c5358dbb072c7ff6e.zip opensim-SC_OLD-ff36a1bc7bcd1d0fe5aecb4c5358dbb072c7ff6e.tar.gz opensim-SC_OLD-ff36a1bc7bcd1d0fe5aecb4c5358dbb072c7ff6e.tar.bz2 opensim-SC_OLD-ff36a1bc7bcd1d0fe5aecb4c5358dbb072c7ff6e.tar.xz |
If a friends identifier which is too short is given to HGFriendsModule.GetOnlineFriends() then spit out a warning rather than failing on the String.Substring().
This is to progress http://opensimulator.org/mantis/view.php?id=5789
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 626ebb5..133da0f 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -11088,6 +11088,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11088 | Utils.BytesToString(avatarInterestUpdate.PropertiesData.LanguagesText)); | 11088 | Utils.BytesToString(avatarInterestUpdate.PropertiesData.LanguagesText)); |
11089 | return true; | 11089 | return true; |
11090 | } | 11090 | } |
11091 | |||
11091 | private bool HandleGrantUserRights(IClientAPI sender, Packet Pack) | 11092 | private bool HandleGrantUserRights(IClientAPI sender, Packet Pack) |
11092 | { | 11093 | { |
11093 | GrantUserRightsPacket GrantUserRights = | 11094 | GrantUserRightsPacket GrantUserRights = |
@@ -11108,6 +11109,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11108 | GrantUserRights.Rights[0].RelatedRights); | 11109 | GrantUserRights.Rights[0].RelatedRights); |
11109 | return true; | 11110 | return true; |
11110 | } | 11111 | } |
11112 | |||
11111 | private bool HandlePlacesQuery(IClientAPI sender, Packet Pack) | 11113 | private bool HandlePlacesQuery(IClientAPI sender, Packet Pack) |
11112 | { | 11114 | { |
11113 | PlacesQueryPacket placesQueryPacket = | 11115 | PlacesQueryPacket placesQueryPacket = |
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs index dda67f9..02b417f 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs | |||
@@ -141,7 +141,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
141 | { | 141 | { |
142 | List<string> fList = new List<string>(); | 142 | List<string> fList = new List<string>(); |
143 | foreach (string s in friendList) | 143 | foreach (string s in friendList) |
144 | fList.Add(s.Substring(0, 36)); | 144 | { |
145 | if (s.Length < 36) | ||
146 | m_log.WarnFormat( | ||
147 | "[HGFRIENDS MODULE]: Ignoring friend {0} ({1} chars) for {2} since identifier too short", | ||
148 | s, s.Length, userID); | ||
149 | else | ||
150 | fList.Add(s.Substring(0, 36)); | ||
151 | } | ||
145 | 152 | ||
146 | PresenceInfo[] presence = PresenceService.GetAgents(fList.ToArray()); | 153 | PresenceInfo[] presence = PresenceService.GetAgents(fList.ToArray()); |
147 | foreach (PresenceInfo pi in presence) | 154 | foreach (PresenceInfo pi in presence) |