Added sanity check in OSDParser.DeserializeLLSDBinary() to check if the stream is seekable

git-svn-id: http://libopenmetaverse.googlecode.com/svn/libopenmetaverse/trunk@2324 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
John Hurliman
2008-11-05 02:00:07 +00:00
parent 61c8451fac
commit 5e91478192

View File

@@ -91,11 +91,14 @@ namespace OpenMetaverse.StructuredData
/// <returns></returns>
public static OSD DeserializeLLSDBinary(Stream stream)
{
if (!stream.CanSeek)
throw new OSDException("Cannot deserialize binary LLSD from unseekable streams");
SkipWhiteSpace(stream);
bool result = FindByteArray(stream, llsdBinaryHead);
if (!result)
throw new OSDException("No binary encoded SD.");
throw new OSDException("Failed to decode binary LLSD");
return ParseLLSDBinaryElement(stream);
}