diff options
author | Melanie | 2010-11-22 23:31:29 +0100 |
---|---|---|
committer | Melanie | 2010-11-22 23:31:29 +0100 |
commit | 571becefb652869fa844188cadf8aca1fea774ab (patch) | |
tree | 1768fee146ca42ba24b7576fb4db134ca2185e38 /OpenSim/Region/ScriptEngine | |
parent | Make an invalud key string in llTextBox and llDialog non fatal to avoid (diff) | |
download | opensim-SC_OLD-571becefb652869fa844188cadf8aca1fea774ab.zip opensim-SC_OLD-571becefb652869fa844188cadf8aca1fea774ab.tar.gz opensim-SC_OLD-571becefb652869fa844188cadf8aca1fea774ab.tar.bz2 opensim-SC_OLD-571becefb652869fa844188cadf8aca1fea774ab.tar.xz |
Fix some crashes caused by the addition of the CreatorData column
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 1ba28dc..7e9224d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -10177,6 +10177,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
10177 | if (str2 == String.Empty) | 10177 | if (str2 == String.Empty) |
10178 | return str1; | 10178 | return str1; |
10179 | 10179 | ||
10180 | int len = str2.Length; | ||
10181 | if ((len % 4) != 0) // LL is EVIL!!!! | ||
10182 | { | ||
10183 | while (str2.EndsWith("=")) | ||
10184 | str2 = str2.Substring(0, str2.Length - 1); | ||
10185 | |||
10186 | len = str2.Length; | ||
10187 | int mod = len % 4; | ||
10188 | |||
10189 | if (mod == 1) | ||
10190 | str2 = str2.Substring(0, str2.Length - 1); | ||
10191 | else if (mod == 2) | ||
10192 | str2 += "=="; | ||
10193 | else if (mod == 3) | ||
10194 | str2 += "="; | ||
10195 | } | ||
10196 | |||
10180 | byte[] data1; | 10197 | byte[] data1; |
10181 | byte[] data2; | 10198 | byte[] data2; |
10182 | try | 10199 | try |
@@ -10200,7 +10217,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
10200 | { | 10217 | { |
10201 | while (pos < data1.Length) | 10218 | while (pos < data1.Length) |
10202 | { | 10219 | { |
10203 | int len = data1.Length - pos; | 10220 | len = data1.Length - pos; |
10204 | if (len > data2.Length) | 10221 | if (len > data2.Length) |
10205 | len = data2.Length; | 10222 | len = data2.Length; |
10206 | 10223 | ||