diff options
author | UbitUmarov | 2015-11-10 15:08:08 +0000 |
---|---|---|
committer | UbitUmarov | 2015-11-10 15:08:08 +0000 |
commit | b6c3592411a0f2b64f3ebd80482fe1fe8cce0097 (patch) | |
tree | 2216e9969fe8e1a78641b2abcd727788a194859a | |
parent | change lldialog and llTextBox maximum message lenght to 512 bytes as specifi... (diff) | |
download | opensim-SC_OLD-b6c3592411a0f2b64f3ebd80482fe1fe8cce0097.zip opensim-SC_OLD-b6c3592411a0f2b64f3ebd80482fe1fe8cce0097.tar.gz opensim-SC_OLD-b6c3592411a0f2b64f3ebd80482fe1fe8cce0097.tar.bz2 opensim-SC_OLD-b6c3592411a0f2b64f3ebd80482fe1fe8cce0097.tar.xz |
fix/add lldialog and llTextBox message size error checks, aborting if error as spec. (we can change this to silent truncate and execute the larger ones since llUdp now does it. But doing as spec now)
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 34a72c9..8154c4f 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -5077,9 +5077,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5077 | { | 5077 | { |
5078 | Error("llTextBox", "Empty message"); | 5078 | Error("llTextBox", "Empty message"); |
5079 | } | 5079 | } |
5080 | else if (message.Length > 512) | 5080 | else if (Encoding.UTF8.GetByteCount(message) > 512) |
5081 | { | 5081 | { |
5082 | Error("llTextBox", "Message more than 512 characters"); | 5082 | Error("llTextBox", "Message longer than 512 bytes"); |
5083 | } | 5083 | } |
5084 | else | 5084 | else |
5085 | { | 5085 | { |
@@ -7908,6 +7908,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7908 | return; | 7908 | return; |
7909 | } | 7909 | } |
7910 | 7910 | ||
7911 | if (message == string.Empty) | ||
7912 | { | ||
7913 | Error("llDialog", "Empty message"); | ||
7914 | } | ||
7915 | else if (Encoding.UTF8.GetByteCount(message) > 512) | ||
7916 | { | ||
7917 | Error("llDialog", "Message longer than 512 bytes"); | ||
7918 | } | ||
7919 | |||
7911 | string[] buts = new string[length]; | 7920 | string[] buts = new string[length]; |
7912 | for (int i = 0; i < length; i++) | 7921 | for (int i = 0; i < length; i++) |
7913 | { | 7922 | { |