summaryrefslogtreecommitdiff
path: root/indra/lscript
diff options
context:
space:
mode:
authorAaron Brashears <aaronb@lindenlab.com>2007-02-02 17:28:58 +0000
committerAaron Brashears <aaronb@lindenlab.com>2007-02-02 17:28:58 +0000
commit305c74d5163c5e344a675d39ca2394a9e45bd2c2 (patch)
tree42836c4a6010b2b015156024d3cfb6bf64a48ad6 /indra/lscript
parent54d89549df38bb61881583a3eb8d3645c107d79f (diff)
Result of svn merge -r57264:57370 svn+ssh://svn/svn/linden/branches/adroit.r40-68 into release.
Diffstat (limited to 'indra/lscript')
-rw-r--r--indra/lscript/lscript_byteformat.h6
-rw-r--r--indra/lscript/lscript_compile/lscript_bytecode.cpp24
-rw-r--r--indra/lscript/lscript_compile/lscript_error.cpp4
-rw-r--r--indra/lscript/lscript_compile/lscript_heap.cpp4
-rw-r--r--indra/lscript/lscript_compile/lscript_scope.h32
-rw-r--r--indra/lscript/lscript_compile/lscript_tree.cpp244
-rw-r--r--indra/lscript/lscript_compile/lscript_tree.h2
-rw-r--r--indra/lscript/lscript_execute/lscript_execute.cpp39
-rw-r--r--indra/lscript/lscript_execute/lscript_readlso.cpp8
-rw-r--r--indra/lscript/lscript_library.h89
-rw-r--r--indra/lscript/lscript_library/lscript_alloc.cpp36
-rw-r--r--indra/lscript/lscript_library/lscript_library.cpp31
12 files changed, 292 insertions, 227 deletions
diff --git a/indra/lscript/lscript_byteformat.h b/indra/lscript/lscript_byteformat.h
index a79f2effae..5e076846ab 100644
--- a/indra/lscript/lscript_byteformat.h
+++ b/indra/lscript/lscript_byteformat.h
@@ -51,7 +51,7 @@ typedef enum e_lscript_registers
LREG_EOF
} LSCRIPTRegisters;
-const S32 gLSCRIPTRegisterAddresses[LREG_EOF] =
+const S32 gLSCRIPTRegisterAddresses[LREG_EOF] = /* Flawfinder: ignore */
{
0, // LREG_INVALID
4, // LREG_IP
@@ -449,7 +449,7 @@ const U8 LSCRIPTTypeHi4Bits[LST_EOF] =
LST_LIST << 4,
};
-const char * const LSCRIPTTypeNames[LST_EOF] =
+const char * const LSCRIPTTypeNames[LST_EOF] = /*Flawfinder: ignore*/
{
"VOID",
"integer",
@@ -492,7 +492,7 @@ typedef enum e_lscript_runtime_faults
LSRF_EOF
} LSCRIPTRunTimeFaults;
-extern char *LSCRIPTRunTimeFaultStrings[LSRF_EOF];
+extern char* LSCRIPTRunTimeFaultStrings[LSRF_EOF]; /*Flawfinder: ignore*/
const S32 LSCRIPTRunTimeFaultBits[LSRF_EOF] =
{
diff --git a/indra/lscript/lscript_compile/lscript_bytecode.cpp b/indra/lscript/lscript_compile/lscript_bytecode.cpp
index 1cf8cd7f28..d6b0fe4926 100644
--- a/indra/lscript/lscript_compile/lscript_bytecode.cpp
+++ b/indra/lscript/lscript_compile/lscript_bytecode.cpp
@@ -59,7 +59,7 @@ void LLScriptByteCodeChunk::addByte(U8 byte)
if (mCodeChunk)
{
U8 *temp = new U8[mCurrentOffset + 1];
- memcpy(temp, mCodeChunk, mCurrentOffset);
+ memcpy(temp, mCodeChunk, mCurrentOffset); /* Flawfinder: ignore */
delete [] mCodeChunk;
mCodeChunk = temp;
}
@@ -83,7 +83,7 @@ void LLScriptByteCodeChunk::addBytes(U8 *bytes, S32 size)
if (mCodeChunk)
{
U8 *temp = new U8[mCurrentOffset + size];
- memcpy(temp, mCodeChunk, mCurrentOffset);
+ memcpy(temp, mCodeChunk, mCurrentOffset); /* Flawfinder: ignore */
delete [] mCodeChunk;
mCodeChunk = temp;
}
@@ -91,7 +91,7 @@ void LLScriptByteCodeChunk::addBytes(U8 *bytes, S32 size)
{
mCodeChunk = new U8[size];
}
- memcpy(mCodeChunk + mCurrentOffset, bytes, size);
+ memcpy(mCodeChunk + mCurrentOffset, bytes, size);/* Flawfinder: ignore */
mCurrentOffset += size;
}
@@ -100,7 +100,7 @@ void LLScriptByteCodeChunk::addBytes(char *bytes, S32 size)
if (mCodeChunk)
{
U8 *temp = new U8[mCurrentOffset + size];
- memcpy(temp, mCodeChunk, mCurrentOffset);
+ memcpy(temp, mCodeChunk, mCurrentOffset); /*Flawfinder: ignore*/
delete [] mCodeChunk;
mCodeChunk = temp;
}
@@ -108,7 +108,7 @@ void LLScriptByteCodeChunk::addBytes(char *bytes, S32 size)
{
mCodeChunk = new U8[size];
}
- memcpy(mCodeChunk + mCurrentOffset, bytes, size);
+ memcpy(mCodeChunk + mCurrentOffset, bytes, size); /*Flawfinder: ignore*/
mCurrentOffset += size;
}
@@ -117,7 +117,7 @@ void LLScriptByteCodeChunk::addBytes(S32 size)
if (mCodeChunk)
{
U8 *temp = new U8[mCurrentOffset + size];
- memcpy(temp, mCodeChunk, mCurrentOffset);
+ memcpy(temp, mCodeChunk, mCurrentOffset); /*Flawfinder: ignore*/
delete [] mCodeChunk;
mCodeChunk = temp;
}
@@ -134,7 +134,7 @@ void LLScriptByteCodeChunk::addBytesDontInc(S32 size)
if (mCodeChunk)
{
U8 *temp = new U8[mCurrentOffset + size];
- memcpy(temp, mCodeChunk, mCurrentOffset);
+ memcpy(temp, mCodeChunk, mCurrentOffset); /*Flawfinder: ignore*/
delete [] mCodeChunk;
mCodeChunk = temp;
}
@@ -237,7 +237,7 @@ void LLScriptScriptCodeChunk::build(FILE *efp, FILE *bcfp)
mCompleteCode = new U8[mTotalSize];
memset(mCompleteCode, 0, mTotalSize);
- memcpy(mCompleteCode, mRegisters->mCodeChunk, mRegisters->mCurrentOffset);
+ memcpy(mCompleteCode, mRegisters->mCodeChunk, mRegisters->mCurrentOffset);
offset += mRegisters->mCurrentOffset;
set_register(mCompleteCode, LREG_IP, 0);
@@ -248,12 +248,12 @@ void LLScriptScriptCodeChunk::build(FILE *efp, FILE *bcfp)
set_register(mCompleteCode, LREG_GVR, offset);
- memcpy(mCompleteCode + offset, mGlobalVariables->mCodeChunk, mGlobalVariables->mCurrentOffset);
+ memcpy(mCompleteCode + offset, mGlobalVariables->mCodeChunk, mGlobalVariables->mCurrentOffset); /*Flawfinder: ignore*/
offset += mGlobalVariables->mCurrentOffset;
set_register(mCompleteCode, LREG_GFR, offset);
- memcpy(mCompleteCode + offset, mGlobalFunctions->mCodeChunk, mGlobalFunctions->mCurrentOffset);
+ memcpy(mCompleteCode + offset, mGlobalFunctions->mCodeChunk, mGlobalFunctions->mCurrentOffset); /*Flawfinder: ignore*/
offset += mGlobalFunctions->mCurrentOffset;
set_register(mCompleteCode, LREG_SR, offset);
@@ -272,12 +272,12 @@ void LLScriptScriptCodeChunk::build(FILE *efp, FILE *bcfp)
}
set_event_register(mCompleteCode, LREG_ER, bytestream2u64(mStates->mCodeChunk, default_state_offset), LSL2_CURRENT_MAJOR_VERSION);
- memcpy(mCompleteCode + offset, mStates->mCodeChunk, mStates->mCurrentOffset);
+ memcpy(mCompleteCode + offset, mStates->mCodeChunk, mStates->mCurrentOffset); /*Flawfinder: ignore*/
offset += mStates->mCurrentOffset;
set_register(mCompleteCode, LREG_HR, offset);
- memcpy(mCompleteCode + offset, mHeap->mCodeChunk, mHeap->mCurrentOffset);
+ memcpy(mCompleteCode + offset, mHeap->mCodeChunk, mHeap->mCurrentOffset); /*Flawfinder: ignore*/
offset += mHeap->mCurrentOffset;
set_register(mCompleteCode, LREG_HP, offset);
diff --git a/indra/lscript/lscript_compile/lscript_error.cpp b/indra/lscript/lscript_compile/lscript_error.cpp
index 0bc51a65ed..bb080924fd 100644
--- a/indra/lscript/lscript_compile/lscript_error.cpp
+++ b/indra/lscript/lscript_compile/lscript_error.cpp
@@ -26,13 +26,13 @@ void LLScriptFilePosition::fdotabs(FILE *fp, S32 tabs, S32 tabsize)
}
}
-char *gWarningText[LSWARN_EOF] =
+char* gWarningText[LSWARN_EOF] = /*Flawfinder: ignore*/
{
"INVALID",
"Dead code found beyond return statement"
};
-char *gErrorText[LSERROR_EOF] =
+char* gErrorText[LSERROR_EOF] = /*Flawfinder: ignore*/
{
"INVALID",
"Syntax error",
diff --git a/indra/lscript/lscript_compile/lscript_heap.cpp b/indra/lscript/lscript_compile/lscript_heap.cpp
index 98c5fe37be..855b6bdba4 100644
--- a/indra/lscript/lscript_compile/lscript_heap.cpp
+++ b/indra/lscript/lscript_compile/lscript_heap.cpp
@@ -34,9 +34,9 @@ LLScriptHeapEntry::~LLScriptHeapEntry()
void LLScriptHeapEntry::addString(char *string)
{
- S32 size = strlen(string) + 1;
+ S32 size = strlen(string) + 1; /*Flawfinder: ignore*/
S32 offset = 0;
- memcpy(mData, string, size);
+ memcpy(mData, string, size); /*Flawfinder: ignore*/
mNext += size;
integer2bytestream(mEntry, offset, mNext);
mRefCount++;
diff --git a/indra/lscript/lscript_compile/lscript_scope.h b/indra/lscript/lscript_compile/lscript_scope.h
index 18640441af..e1a46d4c00 100644
--- a/indra/lscript/lscript_compile/lscript_scope.h
+++ b/indra/lscript/lscript_compile/lscript_scope.h
@@ -26,7 +26,7 @@ typedef enum e_lscript_identifier_type
LIT_EOF
} LSCRIPTIdentifierType;
-const char LSCRIPTFunctionTypeStrings[LST_EOF] =
+const char LSCRIPTFunctionTypeStrings[LST_EOF] = /*Flawfinder: ignore*/
{
'0',
'i',
@@ -39,7 +39,7 @@ const char LSCRIPTFunctionTypeStrings[LST_EOF] =
'0'
};
-const char * const LSCRIPTListDescription[LST_EOF] =
+const char * const LSCRIPTListDescription[LST_EOF] = /*Flawfinder: ignore*/
{
"PUSHARGB 0",
"PUSHARGB 1",
@@ -52,7 +52,7 @@ const char * const LSCRIPTListDescription[LST_EOF] =
"PUSHARGB 0"
};
-const char * const LSCRIPTTypePush[LST_EOF] =
+const char * const LSCRIPTTypePush[LST_EOF] = /*Flawfinder: ignore*/
{
"INVALID",
"PUSHE",
@@ -65,7 +65,7 @@ const char * const LSCRIPTTypePush[LST_EOF] =
"undefined"
};
-const char * const LSCRIPTTypeReturn[LST_EOF] =
+const char * const LSCRIPTTypeReturn[LST_EOF] = /*Flawfinder: ignore*/
{
"INVALID",
"LOADP -12",
@@ -78,7 +78,7 @@ const char * const LSCRIPTTypeReturn[LST_EOF] =
"undefined"
};
-const char * const LSCRIPTTypePop[LST_EOF] =
+const char * const LSCRIPTTypePop[LST_EOF] = /*Flawfinder: ignore*/
{
"INVALID",
"POP",
@@ -91,7 +91,7 @@ const char * const LSCRIPTTypePop[LST_EOF] =
"undefined"
};
-const char * const LSCRIPTTypeDuplicate[LST_EOF] =
+const char * const LSCRIPTTypeDuplicate[LST_EOF] = /*Flawfinder: ignore*/
{
"INVALID",
"DUP",
@@ -104,7 +104,7 @@ const char * const LSCRIPTTypeDuplicate[LST_EOF] =
"undefined"
};
-const char * const LSCRIPTTypeLocalStore[LST_EOF] =
+const char * const LSCRIPTTypeLocalStore[LST_EOF] = /*Flawfinder: ignore*/
{
"INVALID",
"STORE ",
@@ -117,7 +117,7 @@ const char * const LSCRIPTTypeLocalStore[LST_EOF] =
"undefined"
};
-const char * const LSCRIPTTypeLocalDeclaration[LST_EOF] =
+const char * const LSCRIPTTypeLocalDeclaration[LST_EOF] = /*Flawfinder: ignore*/
{
"INVALID",
"STOREP ",
@@ -130,7 +130,7 @@ const char * const LSCRIPTTypeLocalDeclaration[LST_EOF] =
"undefined"
};
-const char * const LSCRIPTTypeGlobalStore[LST_EOF] =
+const char * const LSCRIPTTypeGlobalStore[LST_EOF] = /*Flawfinder: ignore*/
{
"INVALID",
"STOREG ",
@@ -143,7 +143,7 @@ const char * const LSCRIPTTypeGlobalStore[LST_EOF] =
"undefined"
};
-const char * const LSCRIPTTypeLocalPush[LST_EOF] =
+const char * const LSCRIPTTypeLocalPush[LST_EOF] = /*Flawfinder: ignore*/
{
"INVALID",
"PUSH ",
@@ -156,7 +156,7 @@ const char * const LSCRIPTTypeLocalPush[LST_EOF] =
"undefined"
};
-const char * const LSCRIPTTypeLocalPush1[LST_EOF] =
+const char * const LSCRIPTTypeLocalPush1[LST_EOF] = /*Flawfinder: ignore*/
{
"INVALID",
"PUSHARGI 1",
@@ -169,7 +169,7 @@ const char * const LSCRIPTTypeLocalPush1[LST_EOF] =
"undefined"
};
-const char * const LSCRIPTTypeGlobalPush[LST_EOF] =
+const char * const LSCRIPTTypeGlobalPush[LST_EOF] = /*Flawfinder: ignore*/
{
"INVALID",
"PUSHG ",
@@ -194,7 +194,7 @@ public:
{
if (!mString)
return LST_NULL;
- S32 length = (S32)strlen(mString);
+ S32 length = (S32)strlen(mString); /*Flawfinder: ignore*/
if (count >= length)
{
return LST_NULL;
@@ -225,9 +225,9 @@ public:
S32 count = 0;
if (mString)
{
- count = (S32)strlen(mString);
+ count = (S32)strlen(mString); /*Flawfinder: ignore*/
char *temp = new char[count + 2];
- memcpy(temp, mString, count);
+ memcpy(temp, mString, count); /*Flawfinder: ignore*/
delete [] mString;
mString = temp;
mString[count + 1] = 0;
@@ -243,7 +243,7 @@ public:
S32 getNumber()
{
if (mString)
- return (S32)strlen(mString);
+ return (S32)strlen(mString); /*Flawfinder: ignore*/
else
return 0;
}
diff --git a/indra/lscript/lscript_compile/lscript_tree.cpp b/indra/lscript/lscript_compile/lscript_tree.cpp
index 4b4a7f13f4..0b02c3ebb4 100644
--- a/indra/lscript/lscript_compile/lscript_tree.cpp
+++ b/indra/lscript/lscript_compile/lscript_tree.cpp
@@ -251,7 +251,7 @@ void LLScriptConstantString::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCom
break;
case LSCP_EMIT_ASSEMBLY:
fprintf(fp, "PUSHARGS \"%s\"\n", mValue);
- fprintf(fp, "STACKTOS %lu\n", strlen(mValue) + 1);
+ fprintf(fp, "STACKTOS %lu\n", strlen(mValue) + 1); /*Flawfinder: ignore*/
break;
case LSCP_TYPE:
type = mType;
@@ -271,7 +271,7 @@ void LLScriptConstantString::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCom
case LSCP_TO_STACK:
{
chunk->addByte(LSCRIPTOpCodes[LOPC_PUSHARGS]);
- chunk->addBytes(mValue, (S32)strlen(mValue) + 1);
+ chunk->addBytes(mValue, (S32)strlen(mValue) + 1); /*Flawfinder: ignore*/
type = mType;
}
break;
@@ -291,7 +291,7 @@ void LLScriptConstantString::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCom
S32 LLScriptConstantString::getSize()
{
- return (S32)strlen(mValue) + 1;
+ return (S32)strlen(mValue) + 1; /*Flawfinder: ignore*/
}
@@ -1142,7 +1142,7 @@ void LLScriptGlobalVariable::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCom
// it also includes the name of the variable as well as the type
// plus 4 bytes of offset from it's apparent address to the actual data
#ifdef LSL_INCLUDE_DEBUG_INFO
- count += strlen(mIdentifier->mName) + 1 + 1 + 4;
+ count += strlen(mIdentifier->mName) + 1 + 1 + 4; /*Flawfinder: ignore*/
#else
count += 1 + 1 + 4;
#endif
@@ -1165,7 +1165,7 @@ void LLScriptGlobalVariable::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCom
chunk->addBytes(&vtype, 1);
// null terminated name
#ifdef LSL_INCLUDE_DEBUG_INFO
- chunk->addBytes(mIdentifier->mName, strlen(mIdentifier->mName) + 1);
+ chunk->addBytes(mIdentifier->mName, strlen(mIdentifier->mName) + 1); /*Flawfinder: ignore*/
#else
chunk->addBytes(1);
#endif
@@ -1296,7 +1296,7 @@ void LLScriptStateEntryEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCo
{
#ifdef LSL_INCLUDE_DEBUG_INFO
char name[] = "state_entry";
- chunk->addBytes(name, strlen(name) + 1);
+ chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
#endif
}
break;
@@ -1332,7 +1332,7 @@ void LLScriptStateExitEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCom
{
#ifdef LSL_INCLUDE_DEBUG_INFO
char name[] = "state_exit";
- chunk->addBytes(name, strlen(name) + 1);
+ chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
#endif
}
break;
@@ -1390,8 +1390,8 @@ void LLScriptTouchStartEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCo
{
#ifdef LSL_INCLUDE_DEBUG_INFO
char name[] = "touch_start";
- chunk->addBytes(name, strlen(name) + 1);
- chunk->addBytes(mCount->mName, strlen(mCount->mName) + 1);
+ chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mCount->mName, strlen(mCount->mName) + 1); /*Flawfinder: ignore*/
#endif
}
break;
@@ -1448,8 +1448,8 @@ void LLScriptTouchEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompile
{
#ifdef LSL_INCLUDE_DEBUG_INFO
char name[] = "touch";
- chunk->addBytes(name, strlen(name) + 1);
- chunk->addBytes(mCount->mName, strlen(mCount->mName) + 1);
+ chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mCount->mName, strlen(mCount->mName) + 1); /*Flawfinder: ignore*/
#endif
}
break;
@@ -1506,8 +1506,8 @@ void LLScriptTouchEndEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTComp
{
#ifdef LSL_INCLUDE_DEBUG_INFO
char name[] = "touch_end";
- chunk->addBytes(name, strlen(name) + 1);
- chunk->addBytes(mCount->mName, strlen(mCount->mName) + 1);
+ chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mCount->mName, strlen(mCount->mName) + 1); /*Flawfinder: ignore*/
#endif
}
break;
@@ -1564,8 +1564,8 @@ void LLScriptCollisionStartEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRI
{
#ifdef LSL_INCLUDE_DEBUG_INFO
char name[] = "collision_start";
- chunk->addBytes(name, (S32)strlen(name) + 1);
- chunk->addBytes(mCount->mName, (S32)strlen(mCount->mName) + 1);
+ chunk->addBytes(name, (S32)strlen(name) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mCount->mName, (S32)strlen(mCount->mName) + 1); /*Flawfinder: ignore*/
#endif
}
break;
@@ -1622,8 +1622,8 @@ void LLScriptCollisionEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCom
{
#ifdef LSL_INCLUDE_DEBUG_INFO
char name[] = "collision";
- chunk->addBytes(name, strlen(name) + 1);
- chunk->addBytes(mCount->mName, strlen(mCount->mName) + 1);
+ chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mCount->mName, strlen(mCount->mName) + 1); /*Flawfinder: ignore*/
#endif
}
break;
@@ -1680,8 +1680,8 @@ void LLScriptCollisionEndEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPT
{
#ifdef LSL_INCLUDE_DEBUG_INFO
char name[] = "collision_end";
- chunk->addBytes(name, strlen(name) + 1);
- chunk->addBytes(mCount->mName, strlen(mCount->mName) + 1);
+ chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mCount->mName, strlen(mCount->mName) + 1); /*Flawfinder: ignore*/
#endif
}
break;
@@ -1737,8 +1737,8 @@ void LLScriptLandCollisionStartEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, L
{
#ifdef LSL_INCLUDE_DEBUG_INFO
char name[] = "land_collision_start";
- chunk->addBytes(name, strlen(name) + 1);
- chunk->addBytes(mPosition->mName, strlen(mPosition->mName) + 1);
+ chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mPosition->mName, strlen(mPosition->mName) + 1); /*Flawfinder: ignore*/
#endif
}
break;
@@ -1796,8 +1796,8 @@ void LLScriptLandCollisionEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIP
{
#ifdef LSL_INCLUDE_DEBUG_INFO
char name[] = "land_collision";
- chunk->addBytes(name, strlen(name) + 1);
- chunk->addBytes(mPosition->mName, strlen(mPosition->mName) + 1);
+ chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mPosition->mName, strlen(mPosition->mName) + 1); /*Flawfinder: ignore*/
#endif
}
break;
@@ -1853,9 +1853,9 @@ void LLScriptLandCollisionEndEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSC
case LSCP_EMIT_BYTE_CODE:
{
#ifdef LSL_INCLUDE_DEBUG_INFO
- char name[] = "land_collision_end";
- chunk->addBytes(name, strlen(name) + 1);
- chunk->addBytes(mPosition->mName, strlen(mPosition->mName) + 1);
+ char name[] = "land_collision_end"; /*Flawfinder: ignore*/
+ chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mPosition->mName, strlen(mPosition->mName) + 1); /*Flawfinder: ignore*/
#endif
}
break;
@@ -1912,8 +1912,8 @@ void LLScriptInventoryEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCom
{
#ifdef LSL_INCLUDE_DEBUG_INFO
char name[] = "changed";
- chunk->addBytes(name, strlen(name) + 1);
- chunk->addBytes(mChange->mName, strlen(mChange->mName) + 1);
+ chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mChange->mName, strlen(mChange->mName) + 1); /*Flawfinder: ignore*/
#endif
}
break;
@@ -1969,8 +1969,8 @@ void LLScriptAttachEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompil
{
#ifdef LSL_INCLUDE_DEBUG_INFO
char name[] = "attach";
- chunk->addBytes(name, strlen(name) + 1);
- chunk->addBytes(mAttach->mName, strlen(mAttach->mName) + 1);
+ chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mAttach->mName, strlen(mAttach->mName) + 1); /*Flawfinder: ignore*/
#endif
}
break;
@@ -2039,9 +2039,9 @@ void LLScriptDataserverEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCo
{
#ifdef LSL_INCLUDE_DEBUG_INFO
char name[] = "dataserver";
- chunk->addBytes(name, strlen(name) + 1);
- chunk->addBytes(mID->mName, strlen(mID->mName) + 1);
- chunk->addBytes(mData->mName, strlen(mData->mName) + 1);
+ chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mID->mName, strlen(mID->mName) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mData->mName, strlen(mData->mName) + 1); /*Flawfinder: ignore*/
#endif
}
break;
@@ -2077,7 +2077,7 @@ void LLScriptTimerEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompile
{
#ifdef LSL_INCLUDE_DEBUG_INFO
char name[] = "timer";
- chunk->addBytes(name, strlen(name) + 1);
+ chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
#endif
}
break;
@@ -2108,7 +2108,7 @@ void LLScriptMovingStartEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTC
{
#ifdef LSL_INCLUDE_DEBUG_INFO
char name[] = "moving_start";
- chunk->addBytes(name, strlen(name) + 1);
+ chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
#endif
}
break;
@@ -2139,7 +2139,7 @@ void LLScriptMovingEndEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCom
{
#ifdef LSL_INCLUDE_DEBUG_INFO
char name[] = "moving_end";
- chunk->addBytes(name, strlen(name) + 1);
+ chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
#endif
}
break;
@@ -2193,8 +2193,8 @@ void LLScriptRTPEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePa
{
#ifdef LSL_INCLUDE_DEBUG_INFO
char name[] = "chat";
- chunk->addBytes(name, strlen(name) + 1);
- chunk->addBytes(mRTPermissions->mName, strlen(mRTPermissions->mName) + 1);
+ chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mRTPermissions->mName, strlen(mRTPermissions->mName) + 1); /*Flawfinder: ignore*/
#endif
}
break;
@@ -2289,11 +2289,11 @@ void LLScriptChatEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompileP
{
#ifdef LSL_INCLUDE_DEBUG_INFO
char name[] = "chat";
- chunk->addBytes(name, strlen(name) + 1);
- chunk->addBytes(mChannel->mName, strlen(mChannel->mName) + 1);
- chunk->addBytes(mName->mName, strlen(mName->mName) + 1);
- chunk->addBytes(mID->mName, strlen(mID->mName) + 1);
- chunk->addBytes(mMessage->mName, strlen(mMessage->mName) + 1);
+ chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mChannel->mName, strlen(mChannel->mName) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mName->mName, strlen(mName->mName) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mID->mName, strlen(mID->mName) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mMessage->mName, strlen(mMessage->mName) + 1); /*Flawfinder: ignore*/
#endif
}
break;
@@ -2352,8 +2352,8 @@ void LLScriptSensorEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompil
{
#ifdef LSL_INCLUDE_DEBUG_INFO
char name[] = "sensor";
- chunk->addBytes(name, strlen(name) + 1);
- chunk->addBytes(mNumber->mName, strlen(mNumber->mName) + 1);
+ chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mNumber->mName, strlen(mNumber->mName) + 1); /*Flawfinder: ignore*/
#endif
}
break;
@@ -2409,8 +2409,8 @@ void LLScriptObjectRezEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCom
{
#ifdef LSL_INCLUDE_DEBUG_INFO
char name[] = "sensor";
- chunk->addBytes(name, strlen(name) + 1);
- chunk->addBytes(mID->mName, strlen(mID->mName) + 1);
+ chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mID->mName, strlen(mID->mName) + 1); /*Flawfinder: ignore*/
#endif
}
break;
@@ -2492,10 +2492,10 @@ void LLScriptControlEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompi
{
#ifdef LSL_INCLUDE_DEBUG_INFO
char name[] = "control";
- chunk->addBytes(name, strlen(name) + 1);
- chunk->addBytes(mName->mName, strlen(mName->mName) + 1);
- chunk->addBytes(mLevels->mName, strlen(mLevels->mName) + 1);
- chunk->addBytes(mEdges->mName, strlen(mEdges->mName) + 1);
+ chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mName->mName, strlen(mName->mName) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mLevels->mName, strlen(mLevels->mName) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mEdges->mName, strlen(mEdges->mName) + 1); /*Flawfinder: ignore*/
#endif
}
break;
@@ -2592,11 +2592,11 @@ void LLScriptLinkMessageEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTC
{
#ifdef LSL_INCLUDE_DEBUG_INFO
char name[] = "link_message";
- chunk->addBytes(name, strlen(name) + 1);
- chunk->addBytes(mSender->mName, strlen(mSender->mName) + 1);
- chunk->addBytes(mNum->mName, strlen(mNum->mName) + 1);
- chunk->addBytes(mStr->mName, strlen(mStr->mName) + 1);
- chunk->addBytes(mID->mName, strlen(mID->mName) + 1);
+ chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mSender->mName, strlen(mSender->mName) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mNum->mName, strlen(mNum->mName) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mStr->mName, strlen(mStr->mName) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mID->mName, strlen(mID->mName) + 1); /*Flawfinder: ignore*/
#endif
}
break;
@@ -2720,13 +2720,13 @@ void LLScriptRemoteEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompil
{
#ifdef LSL_INCLUDE_DEBUG_INFO
char name[] = "remote_event";
- chunk->addBytes(name, strlen(name) + 1);
- chunk->addBytes(mType->mName, strlen(mType->mName) + 1);
- chunk->addBytes(mChannel->mName, strlen(mChannel->mName) + 1);
- chunk->addBytes(mMessageID->mName, strlen(mMessageID->mName) + 1);
- chunk->addBytes(mSender->mName, strlen(mSender->mName) + 1);
- chunk->addBytes(mIntVal->mName, strlen(mIntVal->mName) + 1);
- chunk->addBytes(mStrVal->mName, strlen(mStrVal->mName) + 1);
+ chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mType->mName, strlen(mType->mName) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mChannel->mName, strlen(mChannel->mName) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mMessageID->mName, strlen(mMessageID->mName) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mSender->mName, strlen(mSender->mName) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mIntVal->mName, strlen(mIntVal->mName) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mStrVal->mName, strlen(mStrVal->mName) + 1); /*Flawfinder: ignore*/
#endif
}
break;
@@ -2835,11 +2835,11 @@ void LLScriptHTTPResponseEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPT
{
#ifdef LSL_INCLUDE_DEBUG_INFO
char name[] = "http_response";
- chunk->addBytes(name, strlen(name) + 1);
- chunk->addBytes(mRequestId->mName, strlen(mRequestId->mName) + 1);
- chunk->addBytes(mStatus->mName, strlen(mStatus->mName) + 1);
- chunk->addBytes(mMetadata->mName, strlen(mMetadata->mName) + 1);
- chunk->addBytes(mBody->mName, strlen(mBody->mName) + 1);
+ chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mRequestId->mName, strlen(mRequestId->mName) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mStatus->mName, strlen(mStatus->mName) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mMetadata->mName, strlen(mMetadata->mName) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mBody->mName, strlen(mBody->mName) + 1); /*Flawfinder: ignore*/
#endif
}
break;
@@ -2913,9 +2913,9 @@ void LLScriptMoneyEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompile
{
#ifdef LSL_INCLUDE_DEBUG_INFO
char name[] = "money";
- chunk->addBytes(name, strlen(name) + 1);
- chunk->addBytes(mName->mName, strlen(mName->mName) + 1);
- chunk->addBytes(mAmount->mName, strlen(mAmount->mName) + 1);
+ chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mName->mName, strlen(mName->mName) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mAmount->mName, strlen(mAmount->mName) + 1); /*Flawfinder: ignore*/
#endif
}
break;
@@ -3024,12 +3024,12 @@ void LLScriptEmailEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompile
{
#ifdef LSL_INCLUDE_DEBUG_INFO
char name[] = "email";
- chunk->addBytes(name, strlen(name) + 1);
- chunk->addBytes(mTime->mName, strlen(mTime->mName) + 1);
- chunk->addBytes(mAddress->mName, strlen(mAddress->mName) + 1);
- chunk->addBytes(mSubject->mName, strlen(mSubject->mName) + 1);
- chunk->addBytes(mBody->mName, strlen(mBody->mName) + 1);
- chunk->addBytes(mNumber->mName, strlen(mNumber->mName) + 1);
+ chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mTime->mName, strlen(mTime->mName) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mAddress->mName, strlen(mAddress->mName) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mSubject->mName, strlen(mSubject->mName) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mBody->mName, strlen(mBody->mName) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mNumber->mName, strlen(mNumber->mName) + 1); /*Flawfinder: ignore*/
#endif
}
break;
@@ -3089,8 +3089,8 @@ void LLScriptRezEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePa
{
#ifdef LSL_INCLUDE_DEBUG_INFO
char name[] = "rez";
- chunk->addBytes(name, strlen(name) + 1);
- chunk->addBytes(mStartParam->mName, strlen(mStartParam->mName) + 1);
+ chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mStartParam->mName, strlen(mStartParam->mName) + 1); /*Flawfinder: ignore*/
#endif
}
break;
@@ -3125,7 +3125,7 @@ void LLScriptNoSensorEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTComp
{
#ifdef LSL_INCLUDE_DEBUG_INFO
char name[] = "no_sensor";
- chunk->addBytes(name, strlen(name) + 1);
+ chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
#endif
}
break;
@@ -3204,11 +3204,11 @@ void LLScriptAtTarget::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePa
case LSCP_EMIT_BYTE_CODE:
{
#ifdef LSL_INCLUDE_DEBUG_INFO
- char name[] = "at_target";
- chunk->addBytes(name, strlen(name) + 1);
- chunk->addBytes(mTargetNumber->mName, strlen(mTargetNumber->mName) + 1);
- chunk->addBytes(mTargetPosition->mName, strlen(mTargetPosition->mName) + 1);
- chunk->addBytes(mOurPosition->mName, strlen(mOurPosition->mName) + 1);
+ char name[] = "at_target"; /*Flawfinder: ignore*/
+ chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mTargetNumber->mName, strlen(mTargetNumber->mName) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mTargetPosition->mName, strlen(mTargetPosition->mName) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mOurPosition->mName, strlen(mOurPosition->mName) + 1); /*Flawfinder: ignore*/
#endif
}
break;
@@ -3246,8 +3246,8 @@ void LLScriptNotAtTarget::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompil
case LSCP_EMIT_BYTE_CODE:
{
#ifdef LSL_INCLUDE_DEBUG_INFO
- char name[] = "not_at_target";
- chunk->addBytes(name, strlen(name) + 1);
+ char name[] = "not_at_target"; /*Flawfinder: ignore*/
+ chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
#endif
}
break;
@@ -3327,10 +3327,10 @@ void LLScriptAtRotTarget::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompil
{
#ifdef LSL_INCLUDE_DEBUG_INFO
char name[] = "at_rot_target";
- chunk->addBytes(name, strlen(name) + 1);
- chunk->addBytes(mTargetNumber->mName, strlen(mTargetNumber->mName) + 1);
- chunk->addBytes(mTargetRotation->mName, strlen(mTargetRotation->mName) + 1);
- chunk->addBytes(mOurRotation->mName, strlen(mOurRotation->mName) + 1);
+ chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mTargetNumber->mName, strlen(mTargetNumber->mName) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mTargetRotation->mName, strlen(mTargetRotation->mName) + 1); /*Flawfinder: ignore*/
+ chunk->addBytes(mOurRotation->mName, strlen(mOurRotation->mName) + 1); /*Flawfinder: ignore*/
#endif
}
break;
@@ -3369,7 +3369,7 @@ void LLScriptNotAtRotTarget::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCom
{
#ifdef LSL_INCLUDE_DEBUG_INFO
char name[] = "not_at_rot_target";
- chunk->addBytes(name, strlen(name) + 1);
+ chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
#endif
}
break;
@@ -7124,7 +7124,7 @@ void LLScriptFunctionCall::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompi
gErrorToText.writeError(fp, this, LSERROR_FUNCTION_TYPE_ERROR);
}
}
- else if (argcount != strlen(mIdentifier->mScopeEntry->mFunctionArgs.mString))
+ else if (argcount != strlen(mIdentifier->mScopeEntry->mFunctionArgs.mString)) /*Flawfinder: ignore*/
{
gErrorToText.writeError(fp, this, LSERROR_FUNCTION_TYPE_ERROR);
}
@@ -7440,7 +7440,7 @@ void add_exit_pops(LLScriptByteCodeChunk *chunk, LLScriptScopeEntry *entry)
if (entry->mLocals.mString)
{
- number = (S32)strlen(entry->mLocals.mString);
+ number = (S32)strlen(entry->mLocals.mString); /*Flawfinder: ignore*/
for (i = number - 1; i >= 0; i--)
{
switch(entry->mLocals.getType(i))
@@ -7473,7 +7473,7 @@ void add_exit_pops(LLScriptByteCodeChunk *chunk, LLScriptScopeEntry *entry)
if (entry->mFunctionArgs.mString)
{
- number = (S32)strlen(entry->mFunctionArgs.mString);
+ number = (S32)strlen(entry->mFunctionArgs.mString); /*Flawfinder: ignore*/
for (i = number - 1; i >= 0; i--)
{
switch(entry->mFunctionArgs.getType(i))
@@ -7512,7 +7512,7 @@ void print_exit_pops(FILE *fp, LLScriptScopeEntry *entry)
if (entry->mLocals.mString)
{
- number = (S32)strlen(entry->mLocals.mString);
+ number = (S32)strlen(entry->mLocals.mString); /*Flawfinder: ignore*/
for (i = number - 1; i >= 0; i--)
{
fprintf(fp, "%s", LSCRIPTTypePop[entry->mLocals.getType(i)]);
@@ -7521,7 +7521,7 @@ void print_exit_pops(FILE *fp, LLScriptScopeEntry *entry)
if (entry->mFunctionArgs.mString)
{
- number = (S32)strlen(entry->mFunctionArgs.mString);
+ number = (S32)strlen(entry->mFunctionArgs.mString); /*Flawfinder: ignore*/
for (i = number - 1; i >= 0; i--)
{
fprintf(fp, "%s", LSCRIPTTypePop[entry->mFunctionArgs.getType(i)]);
@@ -7966,8 +7966,8 @@ void LLScriptIf::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePass pas
break;
case LSCP_EMIT_BYTE_CODE:
{
- char jumpname[32];
- sprintf(jumpname, "##Temp Jump %d##", gTempJumpCount++);
+ char jumpname[32]; /*Flawfinder: ignore*/
+ snprintf(jumpname, sizeof(jumpname),"##Temp Jump %d##", gTempJumpCount++); /*Flawfinder: ignore*/
mExpression->recurse(fp, tabs, tabsize, LSCP_TO_STACK, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL);
chunk->addByte(LSCRIPTOpCodes[LOPC_JUMPNIF]);
@@ -8047,10 +8047,10 @@ void LLScriptIfElse::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePass
break;
case LSCP_EMIT_BYTE_CODE:
{
- char jumpname1[32];
- sprintf(jumpname1, "##Temp Jump %d##", gTempJumpCount++);
- char jumpname2[32];
- sprintf(jumpname2, "##Temp Jump %d##", gTempJumpCount++);
+ char jumpname1[32]; /*Flawfinder: ignore*/
+ snprintf(jumpname1, sizeof(jumpname1), "##Temp Jump %d##", gTempJumpCount++); /*Flawfinder: ignore*/
+ char jumpname2[32]; /*Flawfinder: ignore*/
+ snprintf(jumpname2, sizeof(jumpname2), "##Temp Jump %d##", gTempJumpCount++); /*Flawfinder: ignore*/
mExpression->recurse(fp, tabs, tabsize, LSCP_TO_STACK, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL);
chunk->addByte(LSCRIPTOpCodes[LOPC_JUMPNIF]);
@@ -8150,10 +8150,10 @@ void LLScriptFor::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePass pa
break;
case LSCP_EMIT_BYTE_CODE:
{
- char jumpname1[32];
- sprintf(jumpname1, "##Temp Jump %d##", gTempJumpCount++);
- char jumpname2[32];
- sprintf(jumpname2, "##Temp Jump %d##", gTempJumpCount++);
+ char jumpname1[32]; /*Flawfinder: ignore*/
+ snprintf(jumpname1, sizeof(jumpname1), "##Temp Jump %d##", gTempJumpCount++); /*Flawfinder: ignore*/
+ char jumpname2[32]; /*Flawfinder: ignore*/
+ snprintf(jumpname2, sizeof(jumpname2), "##Temp Jump %d##", gTempJumpCount++); /*Flawfinder: ignore*/
if(mSequence)
mSequence->recurse(fp, tabs, tabsize, LSCP_TO_STACK, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL);
@@ -8247,8 +8247,8 @@ void LLScriptDoWhile::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePas
break;
case LSCP_EMIT_BYTE_CODE:
{
- char jumpname1[32];
- sprintf(jumpname1, "##Temp Jump %d##", gTempJumpCount++);
+ char jumpname1[32]; /*Flawfinder: ignore*/
+ snprintf(jumpname1, sizeof(jumpname1), "##Temp Jump %d##", gTempJumpCount++); /*Flawfinder: ignore*/
chunk->addLabel(jumpname1);
mStatement->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL);
@@ -8321,10 +8321,10 @@ void LLScriptWhile::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePass
break;
case LSCP_EMIT_BYTE_CODE:
{
- char jumpname1[32];
- sprintf(jumpname1, "##Temp Jump %d##", gTempJumpCount++);
- char jumpname2[32];
- sprintf(jumpname2, "##Temp Jump %d##", gTempJumpCount++);
+ char jumpname1[32]; /*Flawfinder: ignore*/
+ snprintf(jumpname1, sizeof(jumpname1), "##Temp Jump %d##", gTempJumpCount++); /*Flawfinder: ignore*/
+ char jumpname2[32]; /*Flawfinder: ignore*/
+ snprintf(jumpname2, sizeof(jumpname2), "##Temp Jump %d##", gTempJumpCount++); /*Flawfinder: ignore*/
chunk->addLabel(jumpname1);
mExpression->recurse(fp, tabs, tabsize, LSCP_TO_STACK, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL);
@@ -8999,7 +8999,7 @@ void LLScriptEventHandler::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompi
fprintf(fp, ".method public hidebysig instance default void ");
// Mangle event handler name by prefixing it with state name. Allows state changing by finding handlers prefixed with new state name.
- fprintf(fp, entry->mIdentifier);
+ fprintf(fp, entry->mIdentifier); /*Flawfinder: ignore*/
// Handler name and arguments.
mEventp->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL);
@@ -9135,7 +9135,7 @@ void LLScriptFunctionDec::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompil
chunk->addBytes(&typereturn, 1);
// name
#ifdef LSL_INCLUDE_DEBUG_INFO
- chunk->addBytes(mIdentifier->mName, strlen(mIdentifier->mName) + 1);
+ chunk->addBytes(mIdentifier->mName, strlen(mIdentifier->mName) + 1); /*Flawfinder: ignore*/
#else
chunk->addBytes(1);
#endif
@@ -9372,7 +9372,7 @@ void LLScriptGlobalFunctions::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCo
// null terminated function name
#ifdef LSL_INCLUDE_DEBUG_INFO
- chunk->addBytes(mIdentifier->mName, strlen(mIdentifier->mName) + 1);
+ chunk->addBytes(mIdentifier->mName, strlen(mIdentifier->mName) + 1); /*Flawfinder: ignore*/
#else
chunk->addBytes(1);
#endif
@@ -9623,7 +9623,7 @@ void LLScriptState::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePass
// null terminated state name
#ifdef LSL_INCLUDE_DEBUG_INFO
- chunk->addBytes(mIdentifier->mName, strlen(mIdentifier->mName) + 1);
+ chunk->addBytes(mIdentifier->mName, strlen(mIdentifier->mName) + 1); /*Flawfinder: ignore*/
#else
chunk->addBytes(1);
#endif
@@ -9678,8 +9678,8 @@ LLScriptScript::LLScriptScript(LLScritpGlobalStorage *globals,
mStates(states), mGlobalScope(NULL), mGlobals(NULL), mGlobalFunctions(NULL), mGodLike(FALSE)
{
const char DEFAULT_BYTECODE_FILENAME[] = "lscript.lso";
- strcpy(mBytecodeDest, DEFAULT_BYTECODE_FILENAME);
-
+ strncpy(mBytecodeDest, DEFAULT_BYTECODE_FILENAME, sizeof(mBytecodeDest) -1); /*Flawfinder: ignore*/
+ mBytecodeDest[MAX_STRING-1] = '\0';
LLScriptGlobalVariable *tvar;
LLScriptGlobalFunctions *tfunc;
LLScritpGlobalStorage *temp;
@@ -9725,7 +9725,7 @@ LLScriptScript::LLScriptScript(LLScritpGlobalStorage *globals,
void LLScriptScript::setBytecodeDest(const char* dst_filename)
{
- strncpy(mBytecodeDest, dst_filename, MAX_STRING);
+ strncpy(mBytecodeDest, dst_filename, MAX_STRING); /*Flawfinder: ignore*/
mBytecodeDest[MAX_STRING-1] = '\0';
}
@@ -9734,7 +9734,7 @@ void print_cil_globals(FILE* fp, LLScriptGlobalVariable* global)
fprintf(fp, ".field private ");
print_cil_type(fp, global->mType->mType);
fprintf(fp, " ");
- fprintf(fp, global->mIdentifier->mName);
+ fprintf(fp, global->mIdentifier->mName); /*Flawfinder: ignore*/
fprintf(fp, "\n");
if(NULL != global->mNextp)
{
@@ -9913,7 +9913,7 @@ void LLScriptScript::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePass
// now, put it all together and spit it out
// we need
- FILE *bcfp = LLFile::fopen(mBytecodeDest, "wb");
+ FILE* bcfp = LLFile::fopen(mBytecodeDest, "wb"); /*Flawfinder: ignore*/
code->build(fp, bcfp);
fclose(bcfp);
diff --git a/indra/lscript/lscript_compile/lscript_tree.h b/indra/lscript/lscript_compile/lscript_tree.h
index c36bae06b9..d0e8bcf389 100644
--- a/indra/lscript/lscript_compile/lscript_tree.h
+++ b/indra/lscript/lscript_compile/lscript_tree.h
@@ -2248,7 +2248,7 @@ public:
BOOL mGodLike;
private:
- char mBytecodeDest[MAX_STRING];
+ char mBytecodeDest[MAX_STRING]; /*Flawfinder: ignore*/
};
class LLScriptAllocationManager
diff --git a/indra/lscript/lscript_execute/lscript_execute.cpp b/indra/lscript/lscript_execute/lscript_execute.cpp
index 3e52334d14..1cbcdc2c58 100644
--- a/indra/lscript/lscript_execute/lscript_execute.cpp
+++ b/indra/lscript/lscript_execute/lscript_execute.cpp
@@ -20,7 +20,7 @@
void (*binary_operations[LST_EOF][LST_EOF])(U8 *buffer, LSCRIPTOpCodesEnum opcode);
void (*unary_operations[LST_EOF])(U8 *buffer, LSCRIPTOpCodesEnum opcode);
-char *LSCRIPTRunTimeFaultStrings[LSRF_EOF] =
+char* LSCRIPTRunTimeFaultStrings[LSRF_EOF] = /*Flawfinder: ignore*/
{
"invalid", // LSRF_INVALID,
"Math Error", // LSRF_MATH,
@@ -2643,7 +2643,7 @@ BOOL run_jumpif(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id)
S32 size = toffset - string;
char *sdata = new char[size];
bytestream2char(sdata, buffer, string);
- if (strlen(sdata))
+ if (strlen(sdata)) /*Flawfinder: ignore*/
{
offset += arg;
}
@@ -2669,7 +2669,7 @@ BOOL run_jumpif(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id)
S32 size = toffset - string;
char *sdata = new char[size];
bytestream2char(sdata, buffer, string);
- if (strlen(sdata))
+ if (strlen(sdata)) /*Flawfinder: ignore*/
{
LLUUID id;
id.set(sdata);
@@ -2758,7 +2758,7 @@ BOOL run_jumpnif(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id)
S32 size = toffset - string;
char *sdata = new char[size];
bytestream2char(sdata, buffer, string);
- if (!strlen(sdata))
+ if (!strlen(sdata)) /*Flawfinder: ignore*/
{
offset += arg;
}
@@ -2784,7 +2784,7 @@ BOOL run_jumpnif(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id)
S32 size = toffset - string;
char *sdata = new char[size];
bytestream2char(sdata, buffer, string);
- if (strlen(sdata))
+ if (strlen(sdata)) /*Flawfinder: ignore*/
{
LLUUID id;
id.set(sdata);
@@ -2935,7 +2935,7 @@ S32 axtoi(char *hexStg)
BOOL run_cast(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id)
{
- char caststr[1024];
+ char caststr[1024]; /*Flawfinder: ignore*/
if (b_print)
printf("[0x%X]\tCAST ", offset);
offset++;
@@ -2968,7 +2968,7 @@ BOOL run_cast(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id)
case LST_STRING:
{
S32 address, source = lscript_pop_int(buffer);
- sprintf(caststr, "%d", source);
+ snprintf(caststr, sizeof(caststr), "%d", source); /*Flawfinder: ignore*/
address = lsa_heap_add_data(buffer, new LLScriptLibData(caststr), get_max_heap_size(buffer), TRUE);
lscript_push(buffer, address);
}
@@ -3005,7 +3005,7 @@ BOOL run_cast(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id)
{
S32 address;
F32 source = lscript_pop_float(buffer);
- sprintf(caststr, "%f", source);
+ snprintf(caststr, sizeof(caststr), "%f", source); /*Flawfinder: ignore*/
address = lsa_heap_add_data(buffer, new LLScriptLibData(caststr), get_max_heap_size(buffer), TRUE);
lscript_push(buffer, address);
}
@@ -3214,7 +3214,7 @@ BOOL run_cast(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id)
S32 address;
LLVector3 source;
lscript_pop_vector(buffer, source);
- sprintf(caststr, "<%5.5f, %5.5f, %5.5f>", source.mV[VX], source.mV[VY], source.mV[VZ]);
+ snprintf(caststr, sizeof(caststr), "<%5.5f, %5.5f, %5.5f>", source.mV[VX], source.mV[VY], source.mV[VZ]); /*Flawfinder: ignore*/
address = lsa_heap_add_data(buffer, new LLScriptLibData(caststr), get_max_heap_size(buffer), TRUE);
lscript_push(buffer, address);
}
@@ -3247,7 +3247,7 @@ BOOL run_cast(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id)
S32 address;
LLQuaternion source;
lscript_pop_quaternion(buffer, source);
- sprintf(caststr, "<%5.5f, %5.5f, %5.5f, %5.5f>", source.mQ[VX], source.mQ[VY], source.mQ[VZ], source.mQ[VS]);
+ snprintf(caststr, sizeof(caststr), "<%5.5f, %5.5f, %5.5f, %5.5f>", source.mQ[VX], source.mQ[VY], source.mQ[VZ], source.mQ[VS]); /*Flawfinder: ignore*/
address = lsa_heap_add_data(buffer, new LLScriptLibData(caststr), get_max_heap_size(buffer), TRUE);
lscript_push(buffer, address);
}
@@ -3571,22 +3571,29 @@ void lscript_run(char *filename, BOOL b_debug)
char *error;
BOOL b_state;
LLScriptExecute *execute = NULL;
- FILE *file = LLFile::fopen(filename, "r");
+ if (filename == NULL)
+ {
+ llerrs << "filename is empty" << llendl;
+ // Just reporting error is likely not enough. Need
+ // to check how to abort or error out gracefully
+ // from this function. XXXTBD
+ }
+ FILE* file = LLFile::fopen(filename, "r"); /* Flawfinder: ignore */
if (file)
{
execute = new LLScriptExecute(file);
fclose(file);
}
- file = LLFile::fopen(filename, "r");
+ file = LLFile::fopen(filename, "r"); /* Flawfinder: ignore */
if (file)
{
- FILE *fp = LLFile::fopen("lscript.parse", "w");
+ FILE* fp = LLFile::fopen("lscript.parse", "w"); /*Flawfinder: ignore*/
LLScriptLSOParse *parse = new LLScriptLSOParse(file);
parse->printData(fp);
fclose(file);
fclose(fp);
}
- file = LLFile::fopen(filename, "r");
+ file = LLFile::fopen(filename, "r"); /*Flawfinder: ignore*/
if (file && execute)
{
timer.reset();
@@ -3795,7 +3802,7 @@ BOOL run_calllib(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id)
if (gScriptLibrary.mFunctions[arg]->mArgs)
{
- number = (S32)strlen(gScriptLibrary.mFunctions[arg]->mArgs);
+ number = (S32)strlen(gScriptLibrary.mFunctions[arg]->mArgs); /*Flawfinder: ignore*/
arguments = new LLScriptLibData[number];
}
else
@@ -3866,7 +3873,7 @@ BOOL run_calllib_two_byte(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &i
if (gScriptLibrary.mFunctions[arg]->mArgs)
{
- number = (S32)strlen(gScriptLibrary.mFunctions[arg]->mArgs);
+ number = (S32)strlen(gScriptLibrary.mFunctions[arg]->mArgs); /*Flawfinder: ignore*/
arguments = new LLScriptLibData[number];
}
else
diff --git a/indra/lscript/lscript_execute/lscript_readlso.cpp b/indra/lscript/lscript_execute/lscript_readlso.cpp
index 2219232a3e..e92c1d2312 100644
--- a/indra/lscript/lscript_execute/lscript_readlso.cpp
+++ b/indra/lscript/lscript_execute/lscript_readlso.cpp
@@ -103,7 +103,7 @@ void LLScriptLSOParse::printGlobals(FILE *fp)
F32 fpvalue;
LLVector3 vvalue;
LLQuaternion qvalue;
- char name[256];
+ char name[256]; /*Flawfinder: ignore*/
U8 type;
S32 global_v_offset = get_register(mRawData, LREG_GVR);
@@ -171,7 +171,7 @@ void LLScriptLSOParse::printGlobalFunctions(FILE *fp)
S32 i, offset;
// LLVector3 vvalue; unused
// LLQuaternion qvalue; unused
- char name[256];
+ char name[256]; /*Flawfinder: ignore*/
U8 type;
offset = get_register(mRawData, LREG_GFR);
@@ -261,7 +261,7 @@ void LLScriptLSOParse::printStates(FILE *fp)
U32 j, k;
// LLVector3 vvalue; unused
// LLQuaternion qvalue; unused
- char name[256];
+ char name[256]; /*Flawfinder: ignore*/
S32 state_offset = get_register(mRawData, LREG_SR);
@@ -1177,7 +1177,7 @@ void print_pushargf(FILE *fp, U8 *buffer, S32 &offset, S32 tabs)
void print_pushargs(FILE *fp, U8 *buffer, S32 &offset, S32 tabs)
{
- char arg[1024];
+ char arg[1024]; /*Flawfinder: ignore*/
lso_print_tabs(fp, tabs);
fprintf(fp, "[0x%X]\tPUSHARGS ", offset++);
bytestream2char(arg, buffer, offset);
diff --git a/indra/lscript/lscript_library.h b/indra/lscript/lscript_library.h
index 3cb1419296..007d36fbcd 100644
--- a/indra/lscript/lscript_library.h
+++ b/indra/lscript/lscript_library.h
@@ -163,10 +163,10 @@ public:
size += 4;
break;
case LST_KEY:
- size += (S32)strlen(mKey) + 1;
+ size += (S32)strlen(mKey) + 1; /*Flawfinder: ignore*/
break;
case LST_STRING:
- size += (S32)strlen(mString) + 1;
+ size += (S32)strlen(mString) + 1; /*Flawfinder: ignore*/
break;
case LST_LIST:
break;
@@ -222,19 +222,29 @@ public:
{
if (data.mKey)
{
- mKey = new char[strlen(data.mKey) + 1];
- strcpy(mKey, data.mKey);
+ mKey = new char[strlen(data.mKey) + 1]; /* Flawfinder: ignore */
+ if (mKey == NULL)
+ {
+ llerrs << "Memory Allocation Failed" << llendl;
+ return;
+ }
+ strcpy(mKey, data.mKey); /* Flawfinder: ignore */
}
if (data.mString)
{
- mString = new char[strlen(data.mString) + 1];
- strcpy(mString, data.mString);
+ mString = new char[strlen(data.mString) + 1]; /* Flawfinder: ignore */
+ if (mString == NULL)
+ {
+ llerrs << "Memory Allocation Failed" << llendl;
+ return;
+ }
+ strcpy(mString, data.mString); /* Flawfinder: ignore */
}
}
LLScriptLibData(U8 *src, S32 &offset) : mListp(NULL)
{
- static char temp[TOP_OF_MEMORY];
+ static char temp[TOP_OF_MEMORY]; /* Flawfinder: ignore */
mType = (LSCRIPTType)bytestream2integer(src, offset);
switch(mType)
{
@@ -247,15 +257,25 @@ public:
case LST_KEY:
{
bytestream2char(temp, src, offset);
- mKey = new char[strlen(temp) + 1];
- strcpy(mKey, temp);
+ mKey = new char[strlen(temp) + 1]; /* Flawfinder: ignore */
+ if (mKey == NULL)
+ {
+ llerrs << "Memory Allocation Failed" << llendl;
+ return;
+ }
+ strcpy(mKey, temp); /* Flawfinder: ignore */
}
break;
case LST_STRING:
{
bytestream2char(temp, src, offset);
- mString = new char[strlen(temp) + 1];
- strcpy(mString, temp);
+ mString = new char[strlen(temp) + 1]; /* Flawfinder: ignore */
+ if (mString == NULL)
+ {
+ llerrs << "Memory Allocation Failed" << llendl;
+ return;
+ }
+ strcpy(mString, temp); /* Flawfinder: ignore */
}
break;
case LST_LIST:
@@ -273,7 +293,7 @@ public:
void set(U8 *src, S32 &offset)
{
- static char temp[TOP_OF_MEMORY];
+ static char temp[TOP_OF_MEMORY]; /* Flawfinder: ignore */
mType = (LSCRIPTType)bytestream2integer(src, offset);
switch(mType)
{
@@ -286,15 +306,25 @@ public:
case LST_KEY:
{
bytestream2char(temp, src, offset);
- mKey = new char[strlen(temp) + 1];
- strcpy(mKey, temp);
+ mKey = new char[strlen(temp) + 1]; /* Flawfinder: ignore */
+ if (mKey == NULL)
+ {
+ llerrs << "Memory Allocation Failed" << llendl;
+ return;
+ }
+ strcpy(mKey, temp); /* Flawfinder: ignore */
}
break;
case LST_STRING:
{
bytestream2char(temp, src, offset);
- mString = new char[strlen(temp) + 1];
- strcpy(mString, temp);
+ mString = new char[strlen(temp) + 1]; /* Flawfinder: ignore */
+ if (mString == NULL)
+ {
+ llerrs << "Memory Allocation Failed" << llendl;
+ return;
+ }
+ strcpy(mString, temp); /* Flawfinder: ignore */
}
break;
case LST_LIST:
@@ -316,8 +346,13 @@ public:
void setFromCSV(char *src)
{
mType = LST_STRING;
- mString = new char[strlen(src) + 1];
- strcpy(mString, src);
+ mString = new char[strlen(src) + 1]; /* Flawfinder: ignore */
+ if (mString == NULL)
+ {
+ llerrs << "Memory Allocation Failed" << llendl;
+ return;
+ }
+ strcpy(mString, src); /* Flawfinder: ignore */
}
LLScriptLibData(S32 integer) : mType(LST_INTEGER), mInteger(integer), mFP(0.f), mKey(NULL), mString(NULL), mVec(), mQuat(), mListp(NULL)
@@ -343,8 +378,13 @@ public:
}
else
{
- mString = new char[strlen(string) + 1];
- strcpy(mString, string);
+ mString = new char[strlen(string) + 1]; /* Flawfinder: ignore */
+ if (mString == NULL)
+ {
+ llerrs << "Memory Allocation Failed" << llendl;
+ return;
+ }
+ strcpy(mString, string); /* Flawfinder: ignore */
}
}
@@ -357,8 +397,13 @@ public:
}
else
{
- mString = new char[strlen(string) + 1];
- strcpy(mString, string);
+ mString = new char[strlen(string) + 1]; /* Flawfinder: ignore */
+ if (mString == NULL)
+ {
+ llerrs << "Memory Allocation Failed" << llendl;
+ return;
+ }
+ strcpy(mString, string); /* Flawfinder: ignore */
}
}
diff --git a/indra/lscript/lscript_library/lscript_alloc.cpp b/indra/lscript/lscript_library/lscript_alloc.cpp
index 86c8729e9c..f26fef6d77 100644
--- a/indra/lscript/lscript_library/lscript_alloc.cpp
+++ b/indra/lscript/lscript_library/lscript_alloc.cpp
@@ -108,10 +108,10 @@ S32 lsa_heap_add_data(U8 *buffer, LLScriptLibData *data, S32 heapsize, BOOL b_de
size = 4;
break;
case LST_KEY:
- size = (S32)strlen(data->mKey) + 1;
+ size = (S32)strlen(data->mKey) + 1; /*Flawfinder: ignore*/
break;
case LST_STRING:
- size = (S32)strlen(data->mString) + 1;
+ size = (S32)strlen(data->mString) + 1; /*Flawfinder: ignore*/
break;
case LST_LIST:
// list data 4 bytes of number of entries followed by number of pointer
@@ -335,7 +335,7 @@ S32 lsa_create_data_block(U8 **buffer, LLScriptLibData *data, S32 base_offset)
{
if (data->mString)
{
- size = (S32)strlen(data->mString) + 1;
+ size = (S32)strlen(data->mString) + 1; /*Flawfinder: ignore*/
}
else
{
@@ -346,7 +346,7 @@ S32 lsa_create_data_block(U8 **buffer, LLScriptLibData *data, S32 base_offset)
{
if (data->mKey)
{
- size = (S32)strlen(data->mKey) + 1;
+ size = (S32)strlen(data->mKey) + 1; /*Flawfinder: ignore*/
}
else
{
@@ -413,8 +413,12 @@ S32 lsa_create_data_block(U8 **buffer, LLScriptLibData *data, S32 base_offset)
if (listsize)
{
U8 *tbuff = new U8[size + listsize];
- memcpy(tbuff, *buffer, size);
- memcpy(tbuff + size, listbuf, listsize);
+ if (tbuff == NULL)
+ {
+ llerrs << "Memory Allocation Failed" << llendl;
+ }
+ memcpy(tbuff, *buffer, size); /*Flawfinder: ignore*/
+ memcpy(tbuff + size, listbuf, listsize); /*Flawfinder: ignore*/
size += listsize;
delete [] *buffer;
delete [] listbuf;
@@ -497,7 +501,7 @@ void lsa_decrease_ref_count(U8 *buffer, S32 offset)
alloc_entry2bytestream(buffer, orig_offset, entry);
}
-char gLSAStringRead[16384];
+char gLSAStringRead[16384]; /*Flawfinder: ignore*/
LLScriptLibData *lsa_get_data(U8 *buffer, S32 &offset, BOOL b_dec_ref)
@@ -538,13 +542,13 @@ LLScriptLibData *lsa_get_data(U8 *buffer, S32 &offset, BOOL b_dec_ref)
break;
case LST_KEY:
bytestream2char(gLSAStringRead, buffer, offset);
- retval->mKey = new char[strlen(gLSAStringRead) + 1];
- strcpy(retval->mKey, gLSAStringRead);
+ retval->mKey = new char[strlen(gLSAStringRead) + 1]; /*Flawfinder: ignore*/
+ strcpy(retval->mKey, gLSAStringRead); /*Flawfinder: ignore*/
break;
case LST_STRING:
bytestream2char(gLSAStringRead, buffer, offset);
- retval->mString = new char[strlen(gLSAStringRead) + 1];
- strcpy(retval->mString, gLSAStringRead);
+ retval->mString = new char[strlen(gLSAStringRead) + 1]; /*Flawfinder: ignore*/
+ strcpy(retval->mString, gLSAStringRead); /*Flawfinder: ignore*/
break;
case LST_VECTOR:
bytestream2vector(retval->mVec, buffer, offset);
@@ -684,13 +688,13 @@ S32 lsa_cat_strings(U8 *buffer, S32 offset1, S32 offset2, S32 heapsize)
return 0;
}
- S32 size = (S32)strlen(test1) + (S32)strlen(test2) + 1;
+ S32 size = (S32)strlen(test1) + (S32)strlen(test2) + 1; /*Flawfinder: ignore*/
LLScriptLibData *string3 = new LLScriptLibData;
string3->mType = LST_STRING;
string3->mString = new char[size];
- strcpy(string3->mString, test1);
- strcat(string3->mString, test2);
+ strcpy(string3->mString, test1); /*Flawfinder: ignore*/
+ strcat(string3->mString, test2); /*Flawfinder: ignore*/
delete string1;
delete string2;
@@ -760,7 +764,7 @@ void lsa_print_heap(U8 *buffer)
F32 fpvalue;
LLVector3 vvalue;
LLQuaternion qvalue;
- char string[4096];
+ char string[4096]; /*Flawfinder: ignore*/
LLScriptAllocEntry entry;
@@ -830,7 +834,7 @@ void lsa_fprint_heap(U8 *buffer, FILE *fp)
F32 fpvalue;
LLVector3 vvalue;
LLQuaternion qvalue;
- char string[4096];
+ char string[4096]; /*Flawfinder: ignore*/
LLScriptAllocEntry entry;
diff --git a/indra/lscript/lscript_library/lscript_library.cpp b/indra/lscript/lscript_library/lscript_library.cpp
index 1af10ae9c4..eef3621d47 100644
--- a/indra/lscript/lscript_library/lscript_library.cpp
+++ b/indra/lscript/lscript_library/lscript_library.cpp
@@ -433,11 +433,17 @@ LLScriptLibraryFunction::LLScriptLibraryFunction(F32 eu, F32 st, void (*exec_fun
mDesc = new char[512];
if (mSleepTime)
{
- sprintf(mDesc,"%s\nSleeps script for %.1f seconds.",desc,mSleepTime);
+ snprintf( /* Flawfinder: ignore */
+ mDesc,
+ 512,
+ "%s\nSleeps script for %.1f seconds.",
+ desc,
+ mSleepTime);
}
else
{
- strcpy(mDesc,desc);
+ strncpy(mDesc, desc, 512); /* Flawfinder: ignore */
+ mDesc[511] = '\0'; // just in case.
}
}
@@ -451,7 +457,10 @@ void LLScriptLibrary::addFunction(LLScriptLibraryFunction *func)
LLScriptLibraryFunction **temp = new LLScriptLibraryFunction*[mNextNumber + 1];
if (mNextNumber)
{
- memcpy(temp, mFunctions, sizeof(LLScriptLibraryFunction *)*mNextNumber);
+ memcpy( /* Flawfinder: ignore */
+ temp,
+ mFunctions,
+ sizeof(LLScriptLibraryFunction*)*mNextNumber);
delete [] mFunctions;
}
mFunctions = temp;
@@ -473,7 +482,7 @@ void LLScriptLibrary::assignExec(char *name, void (*exec_func)(LLScriptLibData *
void LLScriptLibData::print(std::ostream &s, BOOL b_prepend_comma)
{
- char tmp[1024];
+ char tmp[1024]; /*Flawfinder: ignore*/
if (b_prepend_comma)
{
s << ", ";
@@ -484,7 +493,7 @@ void LLScriptLibData::print(std::ostream &s, BOOL b_prepend_comma)
s << mInteger;
break;
case LST_FLOATINGPOINT:
- snprintf(tmp, 1024, "%f", mFP);
+ snprintf(tmp, 1024, "%f", mFP); /*Flawfinder: ignore*/
s << tmp;
break;
case LST_KEY:
@@ -494,12 +503,12 @@ void LLScriptLibData::print(std::ostream &s, BOOL b_prepend_comma)
s << mString;
break;
case LST_VECTOR:
- snprintf(tmp, 1024, "<%f, %f, %f>", mVec.mV[VX],
+ snprintf(tmp, 1024, "<%f, %f, %f>", mVec.mV[VX], /* Flawfinder: ignore */
mVec.mV[VY], mVec.mV[VZ]);
s << tmp;
break;
case LST_QUATERNION:
- snprintf(tmp, 1024, "<%f, %f, %f, %f>", mQuat.mQ[VX], mQuat.mQ[VY],
+ snprintf(tmp, 1024, "<%f, %f, %f, %f>", mQuat.mQ[VX], mQuat.mQ[VY], /* Flawfinder: ignore */
mQuat.mQ[VZ], mQuat.mQ[VS]);
s << tmp;
break;
@@ -517,7 +526,7 @@ void LLScriptLibData::print_separator(std::ostream& ostr, BOOL b_prepend_sep, ch
//print(ostr, FALSE);
{
BOOL b_prepend_comma = FALSE;
- char tmp[1024];
+ char tmp[1024]; /* Flawfinder: ignore */
if (b_prepend_comma)
{
ostr << ", ";
@@ -528,7 +537,7 @@ void LLScriptLibData::print_separator(std::ostream& ostr, BOOL b_prepend_sep, ch
ostr << mInteger;
break;
case LST_FLOATINGPOINT:
- snprintf(tmp, 1024, "%f", mFP);
+ snprintf(tmp, 1024, "%f", mFP); /* Flawfinder: ignore */
ostr << tmp;
break;
case LST_KEY:
@@ -538,12 +547,12 @@ void LLScriptLibData::print_separator(std::ostream& ostr, BOOL b_prepend_sep, ch
ostr << mString;
break;
case LST_VECTOR:
- snprintf(tmp, 1024, "<%f, %f, %f>", mVec.mV[VX],
+ snprintf(tmp, 1024, "<%f, %f, %f>", mVec.mV[VX], /* Flawfinder: ignore */
mVec.mV[VY], mVec.mV[VZ]);
ostr << tmp;
break;
case LST_QUATERNION:
- snprintf(tmp, 1024, "<%f, %f, %f, %f>", mQuat.mQ[VX], mQuat.mQ[VY],
+ snprintf(tmp, 1024, "<%f, %f, %f, %f>", mQuat.mQ[VX], mQuat.mQ[VY], /* Flawfinder: ignore */
mQuat.mQ[VZ], mQuat.mQ[VS]);
ostr << tmp;
break;