aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Serialization/TarArchiveReader.cs
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/Framework/Serialization/TarArchiveReader.cs
parent* An enum for The VisualParams array that the viewer sends us with 90% of the... (diff)
downloadopensim-SC-acf7206f4ba31c7068d9d235c5bd36bb039eb72d.zip
opensim-SC-acf7206f4ba31c7068d9d235c5bd36bb039eb72d.tar.gz
opensim-SC-acf7206f4ba31c7068d9d235c5bd36bb039eb72d.tar.bz2
opensim-SC-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 '')
-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)