.net xml things don't like null terminated strings

This commit is contained in:
UbitUmarov
2020-05-18 01:12:40 +01:00
parent 9ecee558b5
commit e308ab8843
3 changed files with 33 additions and 3 deletions

View File

@@ -193,8 +193,13 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
coa = null;
try
{
int len = data.Length;
if (len < 32)
return false;
if (data[len - 1] == 0)
--len;
// Quickly check if this is a coalesced object, without fully parsing the XML
using (MemoryStream ms = new MemoryStream(data))
using (MemoryStream ms = new MemoryStream(data, 0, len, false))
{
using (XmlTextReader reader = new XmlTextReader(ms))
{