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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user