diff options
Diffstat (limited to 'linden/indra/lscript/lscript_execute/lscript_execute.cpp')
-rw-r--r-- | linden/indra/lscript/lscript_execute/lscript_execute.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/linden/indra/lscript/lscript_execute/lscript_execute.cpp b/linden/indra/lscript/lscript_execute/lscript_execute.cpp index 1d2438c..d1200f0 100644 --- a/linden/indra/lscript/lscript_execute/lscript_execute.cpp +++ b/linden/indra/lscript/lscript_execute/lscript_execute.cpp | |||
@@ -1333,7 +1333,7 @@ BOOL run_pushargs(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id) | |||
1333 | S32 size = toffset - offset; | 1333 | S32 size = toffset - offset; |
1334 | char *arg = new char[size]; | 1334 | char *arg = new char[size]; |
1335 | offset++; | 1335 | offset++; |
1336 | safe_instruction_bytestream2char(arg, buffer, offset); | 1336 | safe_instruction_bytestream2char(arg, buffer, offset, size); |
1337 | if (b_print) | 1337 | if (b_print) |
1338 | printf("%s\n", arg); | 1338 | printf("%s\n", arg); |
1339 | S32 address = lsa_heap_add_data(buffer, new LLScriptLibData(arg), get_max_heap_size(buffer), TRUE); | 1339 | S32 address = lsa_heap_add_data(buffer, new LLScriptLibData(arg), get_max_heap_size(buffer), TRUE); |
@@ -2753,7 +2753,7 @@ BOOL run_jumpif(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id) | |||
2753 | safe_heap_bytestream_count_char(buffer, toffset); | 2753 | safe_heap_bytestream_count_char(buffer, toffset); |
2754 | S32 size = toffset - string; | 2754 | S32 size = toffset - string; |
2755 | char *sdata = new char[size]; | 2755 | char *sdata = new char[size]; |
2756 | bytestream2char(sdata, buffer, string); | 2756 | bytestream2char(sdata, buffer, string, size); |
2757 | if (strlen(sdata)) /*Flawfinder: ignore*/ | 2757 | if (strlen(sdata)) /*Flawfinder: ignore*/ |
2758 | { | 2758 | { |
2759 | offset += arg; | 2759 | offset += arg; |
@@ -2781,7 +2781,7 @@ BOOL run_jumpif(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id) | |||
2781 | safe_heap_bytestream_count_char(buffer, toffset); | 2781 | safe_heap_bytestream_count_char(buffer, toffset); |
2782 | S32 size = toffset - string; | 2782 | S32 size = toffset - string; |
2783 | char *sdata = new char[size]; | 2783 | char *sdata = new char[size]; |
2784 | bytestream2char(sdata, buffer, string); | 2784 | bytestream2char(sdata, buffer, string, size); |
2785 | if (strlen(sdata)) /*Flawfinder: ignore*/ | 2785 | if (strlen(sdata)) /*Flawfinder: ignore*/ |
2786 | { | 2786 | { |
2787 | LLUUID id; | 2787 | LLUUID id; |
@@ -2880,7 +2880,7 @@ BOOL run_jumpnif(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id) | |||
2880 | safe_heap_bytestream_count_char(buffer, toffset); | 2880 | safe_heap_bytestream_count_char(buffer, toffset); |
2881 | S32 size = toffset - string; | 2881 | S32 size = toffset - string; |
2882 | char *sdata = new char[size]; | 2882 | char *sdata = new char[size]; |
2883 | bytestream2char(sdata, buffer, string); | 2883 | bytestream2char(sdata, buffer, string, size); |
2884 | if (!strlen(sdata)) /*Flawfinder: ignore*/ | 2884 | if (!strlen(sdata)) /*Flawfinder: ignore*/ |
2885 | { | 2885 | { |
2886 | offset += arg; | 2886 | offset += arg; |
@@ -2908,7 +2908,7 @@ BOOL run_jumpnif(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id) | |||
2908 | safe_heap_bytestream_count_char(buffer, toffset); | 2908 | safe_heap_bytestream_count_char(buffer, toffset); |
2909 | S32 size = toffset - string; | 2909 | S32 size = toffset - string; |
2910 | char *sdata = new char[size]; | 2910 | char *sdata = new char[size]; |
2911 | bytestream2char(sdata, buffer, string); | 2911 | bytestream2char(sdata, buffer, string, size); |
2912 | if (strlen(sdata)) /*Flawfinder: ignore*/ | 2912 | if (strlen(sdata)) /*Flawfinder: ignore*/ |
2913 | { | 2913 | { |
2914 | LLUUID id; | 2914 | LLUUID id; |
@@ -3182,7 +3182,7 @@ BOOL run_cast(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id) | |||
3182 | safe_heap_bytestream_count_char(buffer, toffset); | 3182 | safe_heap_bytestream_count_char(buffer, toffset); |
3183 | S32 size = toffset - string; | 3183 | S32 size = toffset - string; |
3184 | char *arg = new char[size]; | 3184 | char *arg = new char[size]; |
3185 | bytestream2char(arg, buffer, string); | 3185 | bytestream2char(arg, buffer, string, size); |
3186 | // S32 length = strlen(arg); | 3186 | // S32 length = strlen(arg); |
3187 | S32 dest; | 3187 | S32 dest; |
3188 | S32 base; | 3188 | S32 base; |
@@ -3225,7 +3225,7 @@ BOOL run_cast(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id) | |||
3225 | safe_heap_bytestream_count_char(buffer, toffset); | 3225 | safe_heap_bytestream_count_char(buffer, toffset); |
3226 | S32 size = toffset - string; | 3226 | S32 size = toffset - string; |
3227 | char *arg = new char[size]; | 3227 | char *arg = new char[size]; |
3228 | bytestream2char(arg, buffer, string); | 3228 | bytestream2char(arg, buffer, string, size); |
3229 | F32 dest = (F32)atof(arg); | 3229 | F32 dest = (F32)atof(arg); |
3230 | 3230 | ||
3231 | 3231 | ||
@@ -3265,7 +3265,7 @@ BOOL run_cast(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id) | |||
3265 | safe_heap_bytestream_count_char(buffer, toffset); | 3265 | safe_heap_bytestream_count_char(buffer, toffset); |
3266 | S32 size = toffset - string; | 3266 | S32 size = toffset - string; |
3267 | char *arg = new char[size]; | 3267 | char *arg = new char[size]; |
3268 | bytestream2char(arg, buffer, string); | 3268 | bytestream2char(arg, buffer, string, size); |
3269 | LLVector3 vec; | 3269 | LLVector3 vec; |
3270 | S32 num = sscanf(arg, "<%f, %f, %f>", &vec.mV[VX], &vec.mV[VY], &vec.mV[VZ]); | 3270 | S32 num = sscanf(arg, "<%f, %f, %f>", &vec.mV[VX], &vec.mV[VY], &vec.mV[VZ]); |
3271 | if (num != 3) | 3271 | if (num != 3) |
@@ -3295,7 +3295,7 @@ BOOL run_cast(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id) | |||
3295 | safe_heap_bytestream_count_char(buffer, toffset); | 3295 | safe_heap_bytestream_count_char(buffer, toffset); |
3296 | S32 size = toffset - string; | 3296 | S32 size = toffset - string; |
3297 | char *arg = new char[size]; | 3297 | char *arg = new char[size]; |
3298 | bytestream2char(arg, buffer, string); | 3298 | bytestream2char(arg, buffer, string, size); |
3299 | LLQuaternion quat; | 3299 | LLQuaternion quat; |
3300 | S32 num = sscanf(arg, "<%f, %f, %f, %f>", &quat.mQ[VX], &quat.mQ[VY], &quat.mQ[VZ], &quat.mQ[VW]); | 3300 | S32 num = sscanf(arg, "<%f, %f, %f, %f>", &quat.mQ[VX], &quat.mQ[VY], &quat.mQ[VZ], &quat.mQ[VW]); |
3301 | if (num != 4) | 3301 | if (num != 4) |
@@ -3496,7 +3496,7 @@ void lscript_stacktol_pop_variable(LLScriptLibData *data, U8 *buffer, char type) | |||
3496 | safe_heap_bytestream_count_char(buffer, toffset); | 3496 | safe_heap_bytestream_count_char(buffer, toffset); |
3497 | S32 size = toffset - string; | 3497 | S32 size = toffset - string; |
3498 | data->mKey = new char[size]; | 3498 | data->mKey = new char[size]; |
3499 | bytestream2char(data->mKey, buffer, string); | 3499 | bytestream2char(data->mKey, buffer, string, size); |
3500 | } | 3500 | } |
3501 | lsa_decrease_ref_count(buffer, base_address); | 3501 | lsa_decrease_ref_count(buffer, base_address); |
3502 | } | 3502 | } |
@@ -3523,7 +3523,7 @@ void lscript_stacktol_pop_variable(LLScriptLibData *data, U8 *buffer, char type) | |||
3523 | safe_heap_bytestream_count_char(buffer, toffset); | 3523 | safe_heap_bytestream_count_char(buffer, toffset); |
3524 | S32 size = toffset - string; | 3524 | S32 size = toffset - string; |
3525 | data->mString = new char[size]; | 3525 | data->mString = new char[size]; |
3526 | bytestream2char(data->mString, buffer, string); | 3526 | bytestream2char(data->mString, buffer, string, size); |
3527 | } | 3527 | } |
3528 | lsa_decrease_ref_count(buffer, base_address); | 3528 | lsa_decrease_ref_count(buffer, base_address); |
3529 | } | 3529 | } |
@@ -3623,7 +3623,7 @@ BOOL run_print(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id) | |||
3623 | safe_heap_bytestream_count_char(buffer, toffset); | 3623 | safe_heap_bytestream_count_char(buffer, toffset); |
3624 | S32 size = toffset - string; | 3624 | S32 size = toffset - string; |
3625 | char *arg = new char[size]; | 3625 | char *arg = new char[size]; |
3626 | bytestream2char(arg, buffer, string); | 3626 | bytestream2char(arg, buffer, string, size); |
3627 | printf("%s\n", arg); | 3627 | printf("%s\n", arg); |
3628 | delete [] arg; | 3628 | delete [] arg; |
3629 | } | 3629 | } |
@@ -3787,7 +3787,7 @@ void lscript_pop_variable(LLScriptLibData *data, U8 *buffer, char type) | |||
3787 | safe_heap_bytestream_count_char(buffer, toffset); | 3787 | safe_heap_bytestream_count_char(buffer, toffset); |
3788 | S32 size = toffset - string; | 3788 | S32 size = toffset - string; |
3789 | data->mKey = new char[size]; | 3789 | data->mKey = new char[size]; |
3790 | bytestream2char(data->mKey, buffer, string); | 3790 | bytestream2char(data->mKey, buffer, string, size); |
3791 | } | 3791 | } |
3792 | lsa_decrease_ref_count(buffer, base_address); | 3792 | lsa_decrease_ref_count(buffer, base_address); |
3793 | } | 3793 | } |
@@ -3814,7 +3814,7 @@ void lscript_pop_variable(LLScriptLibData *data, U8 *buffer, char type) | |||
3814 | safe_heap_bytestream_count_char(buffer, toffset); | 3814 | safe_heap_bytestream_count_char(buffer, toffset); |
3815 | S32 size = toffset - string; | 3815 | S32 size = toffset - string; |
3816 | data->mString = new char[size]; | 3816 | data->mString = new char[size]; |
3817 | bytestream2char(data->mString, buffer, string); | 3817 | bytestream2char(data->mString, buffer, string, size); |
3818 | } | 3818 | } |
3819 | lsa_decrease_ref_count(buffer, base_address); | 3819 | lsa_decrease_ref_count(buffer, base_address); |
3820 | } | 3820 | } |