summaryrefslogtreecommitdiff
path: root/indra/lscript/lscript_execute/lscript_execute.cpp
diff options
context:
space:
mode:
authorJosh Bell <josh@lindenlab.com>2008-06-19 18:28:20 +0000
committerJosh Bell <josh@lindenlab.com>2008-06-19 18:28:20 +0000
commit1af69c39af0925f2b1fc955327a26f9519823a55 (patch)
treee059bd2f5c9b1564ebc993f560c8b86a1701f59e /indra/lscript/lscript_execute/lscript_execute.cpp
parent852d36a2b771485485c059d5bc3284404046aae5 (diff)
svn merge -r 89027:90119 svn+ssh://svn.lindenlab.com/svn/linden/branches/Branch_1-22-2-Server --> release
Backport server patches from 1.22 Server production branch to the trunk. * DEV-16189 Search: Private Estate on Teen Grid Visibility issue. ** svn merge -r88933:89027 svn+ssh://svn.lindenlab.com/svn/linden/branches/Branch_1-22-Server * QAR-651 / DEV-14894: Convert relevant webservices to use the on/in syntax to prevent them from needlessly hitting mysql.agni ** svn merge -r89027:89030 svn+ssh://svn.lindenlab.com/svn/linden/branches/Branch_1-22-Server * Adding back the type_mask checking which was causing extra terms to be blacklisted. ** svn merge -r89030:89032 svn+ssh://svn.lindenlab.com/svn/linden/branches/Branch_1-22-Server * Under GCC, argument names must match between declaration and definition * Incorrect rename * Cherry pick fix for DEV-16131, already pushed live to agni ** svn merge -c 89174 svn+ssh://svn.lindenlab.com/svn/linden/release * QAR-664 Resolve start-location Errors on Login ** svn merge -r 88842:89176 svn+ssh://svn.lindenlab.com/svn/linden/branches/user_start_location_missing_fix * QAR-668 / SEC-53: Script that crashes regions (Round 2) ** svn merge -r 89206:89210 svn+ssh://svn.lindenlab.com/svn/linden/branches/Branch_1-22-2-Server_DEV-12357 * QAR-579 / SEC-77 - prevent sim crash caused by libsl proxy packet injection ** svn merge -r 87143:87226 svn+ssh://svn.lindenlab.com/svn/linden/branches/sec-77-crash * DEV-16297 Error Message Can't rez object because you are not allowed on the parcel on some group owned parcels ; Group permissions & rezzing on group land changed in 1.22.2 * DEV-16189 - New query to get a region's parent estate, so we can hide main grid regions from teen users (and vice versa) in All search. * svn merge -r 89494:89593 svn+ssh://svn.lindenlab.com/svn/linden/branches/safe-locations/kill-table-scan --> Branch_1-22-2-Server * simulator.xml file that has improved-im and send-mail enabled. * DEV-16477 and DEV-16380 - fixes to prevent ever expanding db table and writing LLMETRICS to syslog for streambase. * Fixed a teeny bug that caused sorting to be messed and broke DEV-16745. * Adding geolocation IsPass proc to Branch-1-22-2. It is needed to login.cgi work that can only be done against agni at the moment * QAR-693 svn merge -r89984:89986 svn+ssh://svn/svn/linden/branches/security/rez-attach_sec-95 into Branch_1-22-Server. * QAR-619 svn merge -r87886:87945 svn+ssh://svn.lindenlab.com/svn/linden/branches/security/sim-crash-sec-83 into Branch_1-22-Server * Permanently enabling procs as part of DEV-14770 - Enable script-data-requests * Changed TTL to 300 seconds (5 mins) to match lldatabaseconnector's time out value * Permanently enabled parcel-info. Deployed to grid: June 18, 2008. Tracking Jira DEV-14135 * Updated named query TTL to 3600. Used to be 0
Diffstat (limited to 'indra/lscript/lscript_execute/lscript_execute.cpp')
-rw-r--r--indra/lscript/lscript_execute/lscript_execute.cpp57
1 files changed, 33 insertions, 24 deletions
diff --git a/indra/lscript/lscript_execute/lscript_execute.cpp b/indra/lscript/lscript_execute/lscript_execute.cpp
index 77e24cd8f4..70202f7d4d 100644
--- a/indra/lscript/lscript_execute/lscript_execute.cpp
+++ b/indra/lscript/lscript_execute/lscript_execute.cpp
@@ -2309,14 +2309,24 @@ void list_list_operation(U8 *buffer, LSCRIPTOpCodesEnum opcode)
}
}
+static U8 safe_op_index(U8 index)
+{
+ if(index >= LST_EOF)
+ {
+ // Operations on LST_NULL will always be unknown_operation.
+ index = LST_NULL;
+ }
+ return index;
+}
+
BOOL run_add(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id)
{
if (b_print)
printf("[0x%X]\tADD ", offset);
offset++;
U8 arg = safe_instruction_bytestream2byte(buffer, offset);
- U8 arg1 = arg >> 4;
- U8 arg2 = arg & 0xf;
+ U8 arg1 = safe_op_index(arg >> 4);
+ U8 arg2 = safe_op_index(arg & 0xf);
if (b_print)
{
print_type(arg1);
@@ -2334,8 +2344,8 @@ BOOL run_sub(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id)
printf("[0x%X]\tSUB ", offset);
offset++;
U8 arg = safe_instruction_bytestream2byte(buffer, offset);
- U8 arg1 = arg >> 4;
- U8 arg2 = arg & 0xf;
+ U8 arg1 = safe_op_index(arg >> 4);
+ U8 arg2 = safe_op_index(arg & 0xf);
if (b_print)
{
print_type(arg1);
@@ -2352,8 +2362,8 @@ BOOL run_mul(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id)
printf("[0x%X]\tMUL ", offset);
offset++;
U8 arg = safe_instruction_bytestream2byte(buffer, offset);
- U8 arg1 = arg >> 4;
- U8 arg2 = arg & 0xf;
+ U8 arg1 = safe_op_index(arg >> 4);
+ U8 arg2 = safe_op_index(arg & 0xf);
if (b_print)
{
print_type(arg1);
@@ -2370,8 +2380,8 @@ BOOL run_div(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id)
printf("[0x%X]\tDIV ", offset);
offset++;
U8 arg = safe_instruction_bytestream2byte(buffer, offset);
- U8 arg1 = arg >> 4;
- U8 arg2 = arg & 0xf;
+ U8 arg1 = safe_op_index(arg >> 4);
+ U8 arg2 = safe_op_index(arg & 0xf);
if (b_print)
{
print_type(arg1);
@@ -2388,8 +2398,8 @@ BOOL run_mod(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id)
printf("[0x%X]\tMOD ", offset);
offset++;
U8 arg = safe_instruction_bytestream2byte(buffer, offset);
- U8 arg1 = arg >> 4;
- U8 arg2 = arg & 0xf;
+ U8 arg1 = safe_op_index(arg >> 4);
+ U8 arg2 = safe_op_index(arg & 0xf);
if (b_print)
{
print_type(arg1);
@@ -2407,8 +2417,8 @@ BOOL run_eq(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id)
printf("[0x%X]\tEQ ", offset);
offset++;
U8 arg = safe_instruction_bytestream2byte(buffer, offset);
- U8 arg1 = arg >> 4;
- U8 arg2 = arg & 0xf;
+ U8 arg1 = safe_op_index(arg >> 4);
+ U8 arg2 = safe_op_index(arg & 0xf);
if (b_print)
{
print_type(arg1);
@@ -2425,8 +2435,8 @@ BOOL run_neq(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id)
printf("[0x%X]\tNEQ ", offset);
offset++;
U8 arg = safe_instruction_bytestream2byte(buffer, offset);
- U8 arg1 = arg >> 4;
- U8 arg2 = arg & 0xf;
+ U8 arg1 = safe_op_index(arg >> 4);
+ U8 arg2 = safe_op_index(arg & 0xf);
if (b_print)
{
print_type(arg1);
@@ -2443,8 +2453,8 @@ BOOL run_leq(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id)
printf("[0x%X]\tLEQ ", offset);
offset++;
U8 arg = safe_instruction_bytestream2byte(buffer, offset);
- U8 arg1 = arg >> 4;
- U8 arg2 = arg & 0xf;
+ U8 arg1 = safe_op_index(arg >> 4);
+ U8 arg2 = safe_op_index(arg & 0xf);
if (b_print)
{
print_type(arg1);
@@ -2461,8 +2471,8 @@ BOOL run_geq(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id)
printf("[0x%X]\tGEQ ", offset);
offset++;
U8 arg = safe_instruction_bytestream2byte(buffer, offset);
- U8 arg1 = arg >> 4;
- U8 arg2 = arg & 0xf;
+ U8 arg1 = safe_op_index(arg >> 4);
+ U8 arg2 = safe_op_index(arg & 0xf);
if (b_print)
{
print_type(arg1);
@@ -2479,8 +2489,8 @@ BOOL run_less(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id)
printf("[0x%X]\tLESS ", offset);
offset++;
U8 arg = safe_instruction_bytestream2byte(buffer, offset);
- U8 arg1 = arg >> 4;
- U8 arg2 = arg & 0xf;
+ U8 arg1 = safe_op_index(arg >> 4);
+ U8 arg2 = safe_op_index(arg & 0xf);
if (b_print)
{
print_type(arg1);
@@ -2497,8 +2507,8 @@ BOOL run_greater(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id)
printf("[0x%X]\tGREATER ", offset);
offset++;
U8 arg = safe_instruction_bytestream2byte(buffer, offset);
- U8 arg1 = arg >> 4;
- U8 arg2 = arg & 0xf;
+ U8 arg1 = safe_op_index(arg >> 4);
+ U8 arg2 = safe_op_index(arg & 0xf);
if (b_print)
{
print_type(arg1);
@@ -2640,13 +2650,12 @@ void quaternion_operation(U8 *buffer, LSCRIPTOpCodesEnum opcode)
}
}
-
BOOL run_neg(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id)
{
if (b_print)
printf("[0x%X]\tNEG ", offset);
offset++;
- U8 arg = safe_instruction_bytestream2byte(buffer, offset);
+ U8 arg = safe_op_index(safe_instruction_bytestream2byte(buffer, offset));
if (b_print)
{
print_type(arg);