mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 08:55:56 +08:00
.net xml things don't like null terminated strings
This commit is contained in:
@@ -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))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user