aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Agent/AssetTransaction
diff options
context:
space:
mode:
authorMelanie2012-11-17 02:58:14 +0000
committerMelanie2012-11-17 02:58:14 +0000
commit7ad082f7c39ba82adeae3c25ca0befcf983c879d (patch)
tree0e3c488c65ef22b53e4536dd07f46c1467b58f78 /OpenSim/Region/CoreModules/Agent/AssetTransaction
parentMerge branch 'master' into careminster (diff)
parentPrevent a buffer overflow in asset receiving (diff)
downloadopensim-SC_OLD-7ad082f7c39ba82adeae3c25ca0befcf983c879d.zip
opensim-SC_OLD-7ad082f7c39ba82adeae3c25ca0befcf983c879d.tar.gz
opensim-SC_OLD-7ad082f7c39ba82adeae3c25ca0befcf983c879d.tar.bz2
opensim-SC_OLD-7ad082f7c39ba82adeae3c25ca0befcf983c879d.tar.xz
Merge branch 'avination' into careminster
Diffstat (limited to 'OpenSim/Region/CoreModules/Agent/AssetTransaction')
-rw-r--r--OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs31
1 files changed, 20 insertions, 11 deletions
diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs
index f6dd5af..0aa4693 100644
--- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs
+++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs
@@ -136,18 +136,27 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
136 136
137 if (XferID == xferID) 137 if (XferID == xferID)
138 { 138 {
139 if (m_asset.Data.Length > 1) 139 lock (this)
140 { 140 {
141 byte[] destinationArray = new byte[m_asset.Data.Length + data.Length]; 141 int assetLength = m_asset.Data.Length;
142 Array.Copy(m_asset.Data, 0, destinationArray, 0, m_asset.Data.Length); 142 int dataLength = data.Length;
143 Array.Copy(data, 0, destinationArray, m_asset.Data.Length, data.Length); 143
144 m_asset.Data = destinationArray; 144 if (m_asset.Data.Length > 1)
145 } 145 {
146 else 146 byte[] destinationArray = new byte[assetLength + dataLength];
147 { 147 Array.Copy(m_asset.Data, 0, destinationArray, 0, assetLength);
148 byte[] buffer2 = new byte[data.Length - 4]; 148 Array.Copy(data, 0, destinationArray, assetLength, dataLength);
149 Array.Copy(data, 4, buffer2, 0, data.Length - 4); 149 m_asset.Data = destinationArray;
150 m_asset.Data = buffer2; 150 }
151 else
152 {
153 if (dataLength > 4)
154 {
155 byte[] buffer2 = new byte[dataLength - 4];
156 Array.Copy(data, 4, buffer2, 0, dataLength - 4);
157 m_asset.Data = buffer2;
158 }
159 }
151 } 160 }
152 161
153 ourClient.SendConfirmXfer(xferID, packetID); 162 ourClient.SendConfirmXfer(xferID, packetID);