diff --git a/OpenSim/Region/CoreModules/Framework/Search/BasicSearchModule.cs b/OpenSim/Region/CoreModules/Framework/Search/BasicSearchModule.cs index 1026eae91d..8a44ba46bc 100644 --- a/OpenSim/Region/CoreModules/Framework/Search/BasicSearchModule.cs +++ b/OpenSim/Region/CoreModules/Framework/Search/BasicSearchModule.cs @@ -193,7 +193,7 @@ namespace OpenSim.Region.CoreModules.Framework.Search return; } - // filter out groups with no members + // filter out groups DirGroupsReplyData[] result = new DirGroupsReplyData[answer.Count]; int count = 0; foreach(DirGroupsReplyData dgrd in answer) @@ -207,10 +207,18 @@ namespace OpenSim.Region.CoreModules.Framework.Search if ((queryStart > 0) && (queryStart < count)) { int len = count - queryStart; + if (len > 101) // a viewer page is 100 + len = 101; DirGroupsReplyData[] tmp = new DirGroupsReplyData[len]; Array.Copy(result, queryStart, tmp, 0, len); result = tmp; } + else if (count > 101) + { + DirGroupsReplyData[] tmp = new DirGroupsReplyData[101]; + Array.Copy(result, 0, tmp, 0, 101); + result = tmp; + } // TODO: This currently ignores pretty much all the query flags including Mature and sort order remoteClient.SendDirGroupsReply(queryID, result);