Thank you kindly, dslake, for a patch that:

The region dearchive module assumes extra null bytes will be appended 
to the end of every OAR file. This may be due to the block nature of 
storage but it seems like an unsafe assumption. When streaming region 
archives over a network or through a memory stream, no additional null 
bytes are added to the end and this an exception.
trunk
Charles Krinke 2009-08-02 19:30:25 +00:00
parent fea3ffa154
commit acf7206f4b
1 changed files with 4 additions and 0 deletions

View File

@ -105,6 +105,10 @@ namespace OpenSim.Framework.Serialization
{ {
byte[] header = m_br.ReadBytes(512); byte[] header = m_br.ReadBytes(512);
// If there are no more bytes in the stream, return null header
if (header.Length == 0)
return null;
// If we've reached the end of the archive we'll be in null block territory, which means // If we've reached the end of the archive we'll be in null block territory, which means
// the next byte will be 0 // the next byte will be 0
if (header[0] == 0) if (header[0] == 0)