aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorCharles Krinke2009-08-02 19:30:25 +0000
committerCharles Krinke2009-08-02 19:30:25 +0000
commitacf7206f4ba31c7068d9d235c5bd36bb039eb72d (patch)
treefa6b199c9ec48e2b88a3fc7d2e544ff4864296d4 /OpenSim
parent* An enum for The VisualParams array that the viewer sends us with 90% of the... (diff)
downloadopensim-SC_OLD-acf7206f4ba31c7068d9d235c5bd36bb039eb72d.zip
opensim-SC_OLD-acf7206f4ba31c7068d9d235c5bd36bb039eb72d.tar.gz
opensim-SC_OLD-acf7206f4ba31c7068d9d235c5bd36bb039eb72d.tar.bz2
opensim-SC_OLD-acf7206f4ba31c7068d9d235c5bd36bb039eb72d.tar.xz
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.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/Serialization/TarArchiveReader.cs4
1 files changed, 4 insertions, 0 deletions
diff --git a/OpenSim/Framework/Serialization/TarArchiveReader.cs b/OpenSim/Framework/Serialization/TarArchiveReader.cs
index 694ea70..77c29f8 100644
--- a/OpenSim/Framework/Serialization/TarArchiveReader.cs
+++ b/OpenSim/Framework/Serialization/TarArchiveReader.cs
@@ -105,6 +105,10 @@ namespace OpenSim.Framework.Serialization
105 { 105 {
106 byte[] header = m_br.ReadBytes(512); 106 byte[] header = m_br.ReadBytes(512);
107 107
108 // If there are no more bytes in the stream, return null header
109 if (header.Length == 0)
110 return null;
111
108 // If we've reached the end of the archive we'll be in null block territory, which means 112 // If we've reached the end of the archive we'll be in null block territory, which means
109 // the next byte will be 0 113 // the next byte will be 0
110 if (header[0] == 0) 114 if (header[0] == 0)