diff options
Diffstat (limited to 'linden/indra/lscript/lscript_compile/lscript_tree.cpp')
-rw-r--r-- | linden/indra/lscript/lscript_compile/lscript_tree.cpp | 244 |
1 files changed, 122 insertions, 122 deletions
diff --git a/linden/indra/lscript/lscript_compile/lscript_tree.cpp b/linden/indra/lscript/lscript_compile/lscript_tree.cpp index bda09dd..0812ed5 100644 --- a/linden/indra/lscript/lscript_compile/lscript_tree.cpp +++ b/linden/indra/lscript/lscript_compile/lscript_tree.cpp | |||
@@ -270,7 +270,7 @@ void LLScriptConstantString::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCom | |||
270 | break; | 270 | break; |
271 | case LSCP_EMIT_ASSEMBLY: | 271 | case LSCP_EMIT_ASSEMBLY: |
272 | fprintf(fp, "PUSHARGS \"%s\"\n", mValue); | 272 | fprintf(fp, "PUSHARGS \"%s\"\n", mValue); |
273 | fprintf(fp, "STACKTOS %lu\n", strlen(mValue) + 1); | 273 | fprintf(fp, "STACKTOS %lu\n", strlen(mValue) + 1); /*Flawfinder: ignore*/ |
274 | break; | 274 | break; |
275 | case LSCP_TYPE: | 275 | case LSCP_TYPE: |
276 | type = mType; | 276 | type = mType; |
@@ -290,7 +290,7 @@ void LLScriptConstantString::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCom | |||
290 | case LSCP_TO_STACK: | 290 | case LSCP_TO_STACK: |
291 | { | 291 | { |
292 | chunk->addByte(LSCRIPTOpCodes[LOPC_PUSHARGS]); | 292 | chunk->addByte(LSCRIPTOpCodes[LOPC_PUSHARGS]); |
293 | chunk->addBytes(mValue, (S32)strlen(mValue) + 1); | 293 | chunk->addBytes(mValue, (S32)strlen(mValue) + 1); /*Flawfinder: ignore*/ |
294 | type = mType; | 294 | type = mType; |
295 | } | 295 | } |
296 | break; | 296 | break; |
@@ -310,7 +310,7 @@ void LLScriptConstantString::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCom | |||
310 | 310 | ||
311 | S32 LLScriptConstantString::getSize() | 311 | S32 LLScriptConstantString::getSize() |
312 | { | 312 | { |
313 | return (S32)strlen(mValue) + 1; | 313 | return (S32)strlen(mValue) + 1; /*Flawfinder: ignore*/ |
314 | } | 314 | } |
315 | 315 | ||
316 | 316 | ||
@@ -1161,7 +1161,7 @@ void LLScriptGlobalVariable::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCom | |||
1161 | // it also includes the name of the variable as well as the type | 1161 | // it also includes the name of the variable as well as the type |
1162 | // plus 4 bytes of offset from it's apparent address to the actual data | 1162 | // plus 4 bytes of offset from it's apparent address to the actual data |
1163 | #ifdef LSL_INCLUDE_DEBUG_INFO | 1163 | #ifdef LSL_INCLUDE_DEBUG_INFO |
1164 | count += strlen(mIdentifier->mName) + 1 + 1 + 4; | 1164 | count += strlen(mIdentifier->mName) + 1 + 1 + 4; /*Flawfinder: ignore*/ |
1165 | #else | 1165 | #else |
1166 | count += 1 + 1 + 4; | 1166 | count += 1 + 1 + 4; |
1167 | #endif | 1167 | #endif |
@@ -1184,7 +1184,7 @@ void LLScriptGlobalVariable::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCom | |||
1184 | chunk->addBytes(&vtype, 1); | 1184 | chunk->addBytes(&vtype, 1); |
1185 | // null terminated name | 1185 | // null terminated name |
1186 | #ifdef LSL_INCLUDE_DEBUG_INFO | 1186 | #ifdef LSL_INCLUDE_DEBUG_INFO |
1187 | chunk->addBytes(mIdentifier->mName, strlen(mIdentifier->mName) + 1); | 1187 | chunk->addBytes(mIdentifier->mName, strlen(mIdentifier->mName) + 1); /*Flawfinder: ignore*/ |
1188 | #else | 1188 | #else |
1189 | chunk->addBytes(1); | 1189 | chunk->addBytes(1); |
1190 | #endif | 1190 | #endif |
@@ -1315,7 +1315,7 @@ void LLScriptStateEntryEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCo | |||
1315 | { | 1315 | { |
1316 | #ifdef LSL_INCLUDE_DEBUG_INFO | 1316 | #ifdef LSL_INCLUDE_DEBUG_INFO |
1317 | char name[] = "state_entry"; | 1317 | char name[] = "state_entry"; |
1318 | chunk->addBytes(name, strlen(name) + 1); | 1318 | chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/ |
1319 | #endif | 1319 | #endif |
1320 | } | 1320 | } |
1321 | break; | 1321 | break; |
@@ -1351,7 +1351,7 @@ void LLScriptStateExitEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCom | |||
1351 | { | 1351 | { |
1352 | #ifdef LSL_INCLUDE_DEBUG_INFO | 1352 | #ifdef LSL_INCLUDE_DEBUG_INFO |
1353 | char name[] = "state_exit"; | 1353 | char name[] = "state_exit"; |
1354 | chunk->addBytes(name, strlen(name) + 1); | 1354 | chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/ |
1355 | #endif | 1355 | #endif |
1356 | } | 1356 | } |
1357 | break; | 1357 | break; |
@@ -1409,8 +1409,8 @@ void LLScriptTouchStartEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCo | |||
1409 | { | 1409 | { |
1410 | #ifdef LSL_INCLUDE_DEBUG_INFO | 1410 | #ifdef LSL_INCLUDE_DEBUG_INFO |
1411 | char name[] = "touch_start"; | 1411 | char name[] = "touch_start"; |
1412 | chunk->addBytes(name, strlen(name) + 1); | 1412 | chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/ |
1413 | chunk->addBytes(mCount->mName, strlen(mCount->mName) + 1); | 1413 | chunk->addBytes(mCount->mName, strlen(mCount->mName) + 1); /*Flawfinder: ignore*/ |
1414 | #endif | 1414 | #endif |
1415 | } | 1415 | } |
1416 | break; | 1416 | break; |
@@ -1467,8 +1467,8 @@ void LLScriptTouchEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompile | |||
1467 | { | 1467 | { |
1468 | #ifdef LSL_INCLUDE_DEBUG_INFO | 1468 | #ifdef LSL_INCLUDE_DEBUG_INFO |
1469 | char name[] = "touch"; | 1469 | char name[] = "touch"; |
1470 | chunk->addBytes(name, strlen(name) + 1); | 1470 | chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/ |
1471 | chunk->addBytes(mCount->mName, strlen(mCount->mName) + 1); | 1471 | chunk->addBytes(mCount->mName, strlen(mCount->mName) + 1); /*Flawfinder: ignore*/ |
1472 | #endif | 1472 | #endif |
1473 | } | 1473 | } |
1474 | break; | 1474 | break; |
@@ -1525,8 +1525,8 @@ void LLScriptTouchEndEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTComp | |||
1525 | { | 1525 | { |
1526 | #ifdef LSL_INCLUDE_DEBUG_INFO | 1526 | #ifdef LSL_INCLUDE_DEBUG_INFO |
1527 | char name[] = "touch_end"; | 1527 | char name[] = "touch_end"; |
1528 | chunk->addBytes(name, strlen(name) + 1); | 1528 | chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/ |
1529 | chunk->addBytes(mCount->mName, strlen(mCount->mName) + 1); | 1529 | chunk->addBytes(mCount->mName, strlen(mCount->mName) + 1); /*Flawfinder: ignore*/ |
1530 | #endif | 1530 | #endif |
1531 | } | 1531 | } |
1532 | break; | 1532 | break; |
@@ -1583,8 +1583,8 @@ void LLScriptCollisionStartEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRI | |||
1583 | { | 1583 | { |
1584 | #ifdef LSL_INCLUDE_DEBUG_INFO | 1584 | #ifdef LSL_INCLUDE_DEBUG_INFO |
1585 | char name[] = "collision_start"; | 1585 | char name[] = "collision_start"; |
1586 | chunk->addBytes(name, (S32)strlen(name) + 1); | 1586 | chunk->addBytes(name, (S32)strlen(name) + 1); /*Flawfinder: ignore*/ |
1587 | chunk->addBytes(mCount->mName, (S32)strlen(mCount->mName) + 1); | 1587 | chunk->addBytes(mCount->mName, (S32)strlen(mCount->mName) + 1); /*Flawfinder: ignore*/ |
1588 | #endif | 1588 | #endif |
1589 | } | 1589 | } |
1590 | break; | 1590 | break; |
@@ -1641,8 +1641,8 @@ void LLScriptCollisionEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCom | |||
1641 | { | 1641 | { |
1642 | #ifdef LSL_INCLUDE_DEBUG_INFO | 1642 | #ifdef LSL_INCLUDE_DEBUG_INFO |
1643 | char name[] = "collision"; | 1643 | char name[] = "collision"; |
1644 | chunk->addBytes(name, strlen(name) + 1); | 1644 | chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/ |
1645 | chunk->addBytes(mCount->mName, strlen(mCount->mName) + 1); | 1645 | chunk->addBytes(mCount->mName, strlen(mCount->mName) + 1); /*Flawfinder: ignore*/ |
1646 | #endif | 1646 | #endif |
1647 | } | 1647 | } |
1648 | break; | 1648 | break; |
@@ -1699,8 +1699,8 @@ void LLScriptCollisionEndEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPT | |||
1699 | { | 1699 | { |
1700 | #ifdef LSL_INCLUDE_DEBUG_INFO | 1700 | #ifdef LSL_INCLUDE_DEBUG_INFO |
1701 | char name[] = "collision_end"; | 1701 | char name[] = "collision_end"; |
1702 | chunk->addBytes(name, strlen(name) + 1); | 1702 | chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/ |
1703 | chunk->addBytes(mCount->mName, strlen(mCount->mName) + 1); | 1703 | chunk->addBytes(mCount->mName, strlen(mCount->mName) + 1); /*Flawfinder: ignore*/ |
1704 | #endif | 1704 | #endif |
1705 | } | 1705 | } |
1706 | break; | 1706 | break; |
@@ -1756,8 +1756,8 @@ void LLScriptLandCollisionStartEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, L | |||
1756 | { | 1756 | { |
1757 | #ifdef LSL_INCLUDE_DEBUG_INFO | 1757 | #ifdef LSL_INCLUDE_DEBUG_INFO |
1758 | char name[] = "land_collision_start"; | 1758 | char name[] = "land_collision_start"; |
1759 | chunk->addBytes(name, strlen(name) + 1); | 1759 | chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/ |
1760 | chunk->addBytes(mPosition->mName, strlen(mPosition->mName) + 1); | 1760 | chunk->addBytes(mPosition->mName, strlen(mPosition->mName) + 1); /*Flawfinder: ignore*/ |
1761 | #endif | 1761 | #endif |
1762 | } | 1762 | } |
1763 | break; | 1763 | break; |
@@ -1815,8 +1815,8 @@ void LLScriptLandCollisionEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIP | |||
1815 | { | 1815 | { |
1816 | #ifdef LSL_INCLUDE_DEBUG_INFO | 1816 | #ifdef LSL_INCLUDE_DEBUG_INFO |
1817 | char name[] = "land_collision"; | 1817 | char name[] = "land_collision"; |
1818 | chunk->addBytes(name, strlen(name) + 1); | 1818 | chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/ |
1819 | chunk->addBytes(mPosition->mName, strlen(mPosition->mName) + 1); | 1819 | chunk->addBytes(mPosition->mName, strlen(mPosition->mName) + 1); /*Flawfinder: ignore*/ |
1820 | #endif | 1820 | #endif |
1821 | } | 1821 | } |
1822 | break; | 1822 | break; |
@@ -1872,9 +1872,9 @@ void LLScriptLandCollisionEndEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSC | |||
1872 | case LSCP_EMIT_BYTE_CODE: | 1872 | case LSCP_EMIT_BYTE_CODE: |
1873 | { | 1873 | { |
1874 | #ifdef LSL_INCLUDE_DEBUG_INFO | 1874 | #ifdef LSL_INCLUDE_DEBUG_INFO |
1875 | char name[] = "land_collision_end"; | 1875 | char name[] = "land_collision_end"; /*Flawfinder: ignore*/ |
1876 | chunk->addBytes(name, strlen(name) + 1); | 1876 | chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/ |
1877 | chunk->addBytes(mPosition->mName, strlen(mPosition->mName) + 1); | 1877 | chunk->addBytes(mPosition->mName, strlen(mPosition->mName) + 1); /*Flawfinder: ignore*/ |
1878 | #endif | 1878 | #endif |
1879 | } | 1879 | } |
1880 | break; | 1880 | break; |
@@ -1931,8 +1931,8 @@ void LLScriptInventoryEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCom | |||
1931 | { | 1931 | { |
1932 | #ifdef LSL_INCLUDE_DEBUG_INFO | 1932 | #ifdef LSL_INCLUDE_DEBUG_INFO |
1933 | char name[] = "changed"; | 1933 | char name[] = "changed"; |
1934 | chunk->addBytes(name, strlen(name) + 1); | 1934 | chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/ |
1935 | chunk->addBytes(mChange->mName, strlen(mChange->mName) + 1); | 1935 | chunk->addBytes(mChange->mName, strlen(mChange->mName) + 1); /*Flawfinder: ignore*/ |
1936 | #endif | 1936 | #endif |
1937 | } | 1937 | } |
1938 | break; | 1938 | break; |
@@ -1988,8 +1988,8 @@ void LLScriptAttachEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompil | |||
1988 | { | 1988 | { |
1989 | #ifdef LSL_INCLUDE_DEBUG_INFO | 1989 | #ifdef LSL_INCLUDE_DEBUG_INFO |
1990 | char name[] = "attach"; | 1990 | char name[] = "attach"; |
1991 | chunk->addBytes(name, strlen(name) + 1); | 1991 | chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/ |
1992 | chunk->addBytes(mAttach->mName, strlen(mAttach->mName) + 1); | 1992 | chunk->addBytes(mAttach->mName, strlen(mAttach->mName) + 1); /*Flawfinder: ignore*/ |
1993 | #endif | 1993 | #endif |
1994 | } | 1994 | } |
1995 | break; | 1995 | break; |
@@ -2058,9 +2058,9 @@ void LLScriptDataserverEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCo | |||
2058 | { | 2058 | { |
2059 | #ifdef LSL_INCLUDE_DEBUG_INFO | 2059 | #ifdef LSL_INCLUDE_DEBUG_INFO |
2060 | char name[] = "dataserver"; | 2060 | char name[] = "dataserver"; |
2061 | chunk->addBytes(name, strlen(name) + 1); | 2061 | chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/ |
2062 | chunk->addBytes(mID->mName, strlen(mID->mName) + 1); | 2062 | chunk->addBytes(mID->mName, strlen(mID->mName) + 1); /*Flawfinder: ignore*/ |
2063 | chunk->addBytes(mData->mName, strlen(mData->mName) + 1); | 2063 | chunk->addBytes(mData->mName, strlen(mData->mName) + 1); /*Flawfinder: ignore*/ |
2064 | #endif | 2064 | #endif |
2065 | } | 2065 | } |
2066 | break; | 2066 | break; |
@@ -2096,7 +2096,7 @@ void LLScriptTimerEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompile | |||
2096 | { | 2096 | { |
2097 | #ifdef LSL_INCLUDE_DEBUG_INFO | 2097 | #ifdef LSL_INCLUDE_DEBUG_INFO |
2098 | char name[] = "timer"; | 2098 | char name[] = "timer"; |
2099 | chunk->addBytes(name, strlen(name) + 1); | 2099 | chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/ |
2100 | #endif | 2100 | #endif |
2101 | } | 2101 | } |
2102 | break; | 2102 | break; |
@@ -2127,7 +2127,7 @@ void LLScriptMovingStartEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTC | |||
2127 | { | 2127 | { |
2128 | #ifdef LSL_INCLUDE_DEBUG_INFO | 2128 | #ifdef LSL_INCLUDE_DEBUG_INFO |
2129 | char name[] = "moving_start"; | 2129 | char name[] = "moving_start"; |
2130 | chunk->addBytes(name, strlen(name) + 1); | 2130 | chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/ |
2131 | #endif | 2131 | #endif |
2132 | } | 2132 | } |
2133 | break; | 2133 | break; |
@@ -2158,7 +2158,7 @@ void LLScriptMovingEndEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCom | |||
2158 | { | 2158 | { |
2159 | #ifdef LSL_INCLUDE_DEBUG_INFO | 2159 | #ifdef LSL_INCLUDE_DEBUG_INFO |
2160 | char name[] = "moving_end"; | 2160 | char name[] = "moving_end"; |
2161 | chunk->addBytes(name, strlen(name) + 1); | 2161 | chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/ |
2162 | #endif | 2162 | #endif |
2163 | } | 2163 | } |
2164 | break; | 2164 | break; |
@@ -2212,8 +2212,8 @@ void LLScriptRTPEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePa | |||
2212 | { | 2212 | { |
2213 | #ifdef LSL_INCLUDE_DEBUG_INFO | 2213 | #ifdef LSL_INCLUDE_DEBUG_INFO |
2214 | char name[] = "chat"; | 2214 | char name[] = "chat"; |
2215 | chunk->addBytes(name, strlen(name) + 1); | 2215 | chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/ |
2216 | chunk->addBytes(mRTPermissions->mName, strlen(mRTPermissions->mName) + 1); | 2216 | chunk->addBytes(mRTPermissions->mName, strlen(mRTPermissions->mName) + 1); /*Flawfinder: ignore*/ |
2217 | #endif | 2217 | #endif |
2218 | } | 2218 | } |
2219 | break; | 2219 | break; |
@@ -2308,11 +2308,11 @@ void LLScriptChatEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompileP | |||
2308 | { | 2308 | { |
2309 | #ifdef LSL_INCLUDE_DEBUG_INFO | 2309 | #ifdef LSL_INCLUDE_DEBUG_INFO |
2310 | char name[] = "chat"; | 2310 | char name[] = "chat"; |
2311 | chunk->addBytes(name, strlen(name) + 1); | 2311 | chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/ |
2312 | chunk->addBytes(mChannel->mName, strlen(mChannel->mName) + 1); | 2312 | chunk->addBytes(mChannel->mName, strlen(mChannel->mName) + 1); /*Flawfinder: ignore*/ |
2313 | chunk->addBytes(mName->mName, strlen(mName->mName) + 1); | 2313 | chunk->addBytes(mName->mName, strlen(mName->mName) + 1); /*Flawfinder: ignore*/ |
2314 | chunk->addBytes(mID->mName, strlen(mID->mName) + 1); | 2314 | chunk->addBytes(mID->mName, strlen(mID->mName) + 1); /*Flawfinder: ignore*/ |
2315 | chunk->addBytes(mMessage->mName, strlen(mMessage->mName) + 1); | 2315 | chunk->addBytes(mMessage->mName, strlen(mMessage->mName) + 1); /*Flawfinder: ignore*/ |
2316 | #endif | 2316 | #endif |
2317 | } | 2317 | } |
2318 | break; | 2318 | break; |
@@ -2371,8 +2371,8 @@ void LLScriptSensorEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompil | |||
2371 | { | 2371 | { |
2372 | #ifdef LSL_INCLUDE_DEBUG_INFO | 2372 | #ifdef LSL_INCLUDE_DEBUG_INFO |
2373 | char name[] = "sensor"; | 2373 | char name[] = "sensor"; |
2374 | chunk->addBytes(name, strlen(name) + 1); | 2374 | chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/ |
2375 | chunk->addBytes(mNumber->mName, strlen(mNumber->mName) + 1); | 2375 | chunk->addBytes(mNumber->mName, strlen(mNumber->mName) + 1); /*Flawfinder: ignore*/ |
2376 | #endif | 2376 | #endif |
2377 | } | 2377 | } |
2378 | break; | 2378 | break; |
@@ -2428,8 +2428,8 @@ void LLScriptObjectRezEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCom | |||
2428 | { | 2428 | { |
2429 | #ifdef LSL_INCLUDE_DEBUG_INFO | 2429 | #ifdef LSL_INCLUDE_DEBUG_INFO |
2430 | char name[] = "sensor"; | 2430 | char name[] = "sensor"; |
2431 | chunk->addBytes(name, strlen(name) + 1); | 2431 | chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/ |
2432 | chunk->addBytes(mID->mName, strlen(mID->mName) + 1); | 2432 | chunk->addBytes(mID->mName, strlen(mID->mName) + 1); /*Flawfinder: ignore*/ |
2433 | #endif | 2433 | #endif |
2434 | } | 2434 | } |
2435 | break; | 2435 | break; |
@@ -2511,10 +2511,10 @@ void LLScriptControlEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompi | |||
2511 | { | 2511 | { |
2512 | #ifdef LSL_INCLUDE_DEBUG_INFO | 2512 | #ifdef LSL_INCLUDE_DEBUG_INFO |
2513 | char name[] = "control"; | 2513 | char name[] = "control"; |
2514 | chunk->addBytes(name, strlen(name) + 1); | 2514 | chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/ |
2515 | chunk->addBytes(mName->mName, strlen(mName->mName) + 1); | 2515 | chunk->addBytes(mName->mName, strlen(mName->mName) + 1); /*Flawfinder: ignore*/ |
2516 | chunk->addBytes(mLevels->mName, strlen(mLevels->mName) + 1); | 2516 | chunk->addBytes(mLevels->mName, strlen(mLevels->mName) + 1); /*Flawfinder: ignore*/ |
2517 | chunk->addBytes(mEdges->mName, strlen(mEdges->mName) + 1); | 2517 | chunk->addBytes(mEdges->mName, strlen(mEdges->mName) + 1); /*Flawfinder: ignore*/ |
2518 | #endif | 2518 | #endif |
2519 | } | 2519 | } |
2520 | break; | 2520 | break; |
@@ -2611,11 +2611,11 @@ void LLScriptLinkMessageEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTC | |||
2611 | { | 2611 | { |
2612 | #ifdef LSL_INCLUDE_DEBUG_INFO | 2612 | #ifdef LSL_INCLUDE_DEBUG_INFO |
2613 | char name[] = "link_message"; | 2613 | char name[] = "link_message"; |
2614 | chunk->addBytes(name, strlen(name) + 1); | 2614 | chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/ |
2615 | chunk->addBytes(mSender->mName, strlen(mSender->mName) + 1); | 2615 | chunk->addBytes(mSender->mName, strlen(mSender->mName) + 1); /*Flawfinder: ignore*/ |
2616 | chunk->addBytes(mNum->mName, strlen(mNum->mName) + 1); | 2616 | chunk->addBytes(mNum->mName, strlen(mNum->mName) + 1); /*Flawfinder: ignore*/ |
2617 | chunk->addBytes(mStr->mName, strlen(mStr->mName) + 1); | 2617 | chunk->addBytes(mStr->mName, strlen(mStr->mName) + 1); /*Flawfinder: ignore*/ |
2618 | chunk->addBytes(mID->mName, strlen(mID->mName) + 1); | 2618 | chunk->addBytes(mID->mName, strlen(mID->mName) + 1); /*Flawfinder: ignore*/ |
2619 | #endif | 2619 | #endif |
2620 | } | 2620 | } |
2621 | break; | 2621 | break; |
@@ -2739,13 +2739,13 @@ void LLScriptRemoteEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompil | |||
2739 | { | 2739 | { |
2740 | #ifdef LSL_INCLUDE_DEBUG_INFO | 2740 | #ifdef LSL_INCLUDE_DEBUG_INFO |
2741 | char name[] = "remote_event"; | 2741 | char name[] = "remote_event"; |
2742 | chunk->addBytes(name, strlen(name) + 1); | 2742 | chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/ |
2743 | chunk->addBytes(mType->mName, strlen(mType->mName) + 1); | 2743 | chunk->addBytes(mType->mName, strlen(mType->mName) + 1); /*Flawfinder: ignore*/ |
2744 | chunk->addBytes(mChannel->mName, strlen(mChannel->mName) + 1); | 2744 | chunk->addBytes(mChannel->mName, strlen(mChannel->mName) + 1); /*Flawfinder: ignore*/ |
2745 | chunk->addBytes(mMessageID->mName, strlen(mMessageID->mName) + 1); | 2745 | chunk->addBytes(mMessageID->mName, strlen(mMessageID->mName) + 1); /*Flawfinder: ignore*/ |
2746 | chunk->addBytes(mSender->mName, strlen(mSender->mName) + 1); | 2746 | chunk->addBytes(mSender->mName, strlen(mSender->mName) + 1); /*Flawfinder: ignore*/ |
2747 | chunk->addBytes(mIntVal->mName, strlen(mIntVal->mName) + 1); | 2747 | chunk->addBytes(mIntVal->mName, strlen(mIntVal->mName) + 1); /*Flawfinder: ignore*/ |
2748 | chunk->addBytes(mStrVal->mName, strlen(mStrVal->mName) + 1); | 2748 | chunk->addBytes(mStrVal->mName, strlen(mStrVal->mName) + 1); /*Flawfinder: ignore*/ |
2749 | #endif | 2749 | #endif |
2750 | } | 2750 | } |
2751 | break; | 2751 | break; |
@@ -2854,11 +2854,11 @@ void LLScriptHTTPResponseEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPT | |||
2854 | { | 2854 | { |
2855 | #ifdef LSL_INCLUDE_DEBUG_INFO | 2855 | #ifdef LSL_INCLUDE_DEBUG_INFO |
2856 | char name[] = "http_response"; | 2856 | char name[] = "http_response"; |
2857 | chunk->addBytes(name, strlen(name) + 1); | 2857 | chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/ |
2858 | chunk->addBytes(mRequestId->mName, strlen(mRequestId->mName) + 1); | 2858 | chunk->addBytes(mRequestId->mName, strlen(mRequestId->mName) + 1); /*Flawfinder: ignore*/ |
2859 | chunk->addBytes(mStatus->mName, strlen(mStatus->mName) + 1); | 2859 | chunk->addBytes(mStatus->mName, strlen(mStatus->mName) + 1); /*Flawfinder: ignore*/ |
2860 | chunk->addBytes(mMetadata->mName, strlen(mMetadata->mName) + 1); | 2860 | chunk->addBytes(mMetadata->mName, strlen(mMetadata->mName) + 1); /*Flawfinder: ignore*/ |
2861 | chunk->addBytes(mBody->mName, strlen(mBody->mName) + 1); | 2861 | chunk->addBytes(mBody->mName, strlen(mBody->mName) + 1); /*Flawfinder: ignore*/ |
2862 | #endif | 2862 | #endif |
2863 | } | 2863 | } |
2864 | break; | 2864 | break; |
@@ -2932,9 +2932,9 @@ void LLScriptMoneyEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompile | |||
2932 | { | 2932 | { |
2933 | #ifdef LSL_INCLUDE_DEBUG_INFO | 2933 | #ifdef LSL_INCLUDE_DEBUG_INFO |
2934 | char name[] = "money"; | 2934 | char name[] = "money"; |
2935 | chunk->addBytes(name, strlen(name) + 1); | 2935 | chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/ |
2936 | chunk->addBytes(mName->mName, strlen(mName->mName) + 1); | 2936 | chunk->addBytes(mName->mName, strlen(mName->mName) + 1); /*Flawfinder: ignore*/ |
2937 | chunk->addBytes(mAmount->mName, strlen(mAmount->mName) + 1); | 2937 | chunk->addBytes(mAmount->mName, strlen(mAmount->mName) + 1); /*Flawfinder: ignore*/ |
2938 | #endif | 2938 | #endif |
2939 | } | 2939 | } |
2940 | break; | 2940 | break; |
@@ -3043,12 +3043,12 @@ void LLScriptEmailEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompile | |||
3043 | { | 3043 | { |
3044 | #ifdef LSL_INCLUDE_DEBUG_INFO | 3044 | #ifdef LSL_INCLUDE_DEBUG_INFO |
3045 | char name[] = "email"; | 3045 | char name[] = "email"; |
3046 | chunk->addBytes(name, strlen(name) + 1); | 3046 | chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/ |
3047 | chunk->addBytes(mTime->mName, strlen(mTime->mName) + 1); | 3047 | chunk->addBytes(mTime->mName, strlen(mTime->mName) + 1); /*Flawfinder: ignore*/ |
3048 | chunk->addBytes(mAddress->mName, strlen(mAddress->mName) + 1); | 3048 | chunk->addBytes(mAddress->mName, strlen(mAddress->mName) + 1); /*Flawfinder: ignore*/ |
3049 | chunk->addBytes(mSubject->mName, strlen(mSubject->mName) + 1); | 3049 | chunk->addBytes(mSubject->mName, strlen(mSubject->mName) + 1); /*Flawfinder: ignore*/ |
3050 | chunk->addBytes(mBody->mName, strlen(mBody->mName) + 1); | 3050 | chunk->addBytes(mBody->mName, strlen(mBody->mName) + 1); /*Flawfinder: ignore*/ |
3051 | chunk->addBytes(mNumber->mName, strlen(mNumber->mName) + 1); | 3051 | chunk->addBytes(mNumber->mName, strlen(mNumber->mName) + 1); /*Flawfinder: ignore*/ |
3052 | #endif | 3052 | #endif |
3053 | } | 3053 | } |
3054 | break; | 3054 | break; |
@@ -3108,8 +3108,8 @@ void LLScriptRezEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePa | |||
3108 | { | 3108 | { |
3109 | #ifdef LSL_INCLUDE_DEBUG_INFO | 3109 | #ifdef LSL_INCLUDE_DEBUG_INFO |
3110 | char name[] = "rez"; | 3110 | char name[] = "rez"; |
3111 | chunk->addBytes(name, strlen(name) + 1); | 3111 | chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/ |
3112 | chunk->addBytes(mStartParam->mName, strlen(mStartParam->mName) + 1); | 3112 | chunk->addBytes(mStartParam->mName, strlen(mStartParam->mName) + 1); /*Flawfinder: ignore*/ |
3113 | #endif | 3113 | #endif |
3114 | } | 3114 | } |
3115 | break; | 3115 | break; |
@@ -3144,7 +3144,7 @@ void LLScriptNoSensorEvent::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTComp | |||
3144 | { | 3144 | { |
3145 | #ifdef LSL_INCLUDE_DEBUG_INFO | 3145 | #ifdef LSL_INCLUDE_DEBUG_INFO |
3146 | char name[] = "no_sensor"; | 3146 | char name[] = "no_sensor"; |
3147 | chunk->addBytes(name, strlen(name) + 1); | 3147 | chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/ |
3148 | #endif | 3148 | #endif |
3149 | } | 3149 | } |
3150 | break; | 3150 | break; |
@@ -3223,11 +3223,11 @@ void LLScriptAtTarget::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePa | |||
3223 | case LSCP_EMIT_BYTE_CODE: | 3223 | case LSCP_EMIT_BYTE_CODE: |
3224 | { | 3224 | { |
3225 | #ifdef LSL_INCLUDE_DEBUG_INFO | 3225 | #ifdef LSL_INCLUDE_DEBUG_INFO |
3226 | char name[] = "at_target"; | 3226 | char name[] = "at_target"; /*Flawfinder: ignore*/ |
3227 | chunk->addBytes(name, strlen(name) + 1); | 3227 | chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/ |
3228 | chunk->addBytes(mTargetNumber->mName, strlen(mTargetNumber->mName) + 1); | 3228 | chunk->addBytes(mTargetNumber->mName, strlen(mTargetNumber->mName) + 1); /*Flawfinder: ignore*/ |
3229 | chunk->addBytes(mTargetPosition->mName, strlen(mTargetPosition->mName) + 1); | 3229 | chunk->addBytes(mTargetPosition->mName, strlen(mTargetPosition->mName) + 1); /*Flawfinder: ignore*/ |
3230 | chunk->addBytes(mOurPosition->mName, strlen(mOurPosition->mName) + 1); | 3230 | chunk->addBytes(mOurPosition->mName, strlen(mOurPosition->mName) + 1); /*Flawfinder: ignore*/ |
3231 | #endif | 3231 | #endif |
3232 | } | 3232 | } |
3233 | break; | 3233 | break; |
@@ -3265,8 +3265,8 @@ void LLScriptNotAtTarget::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompil | |||
3265 | case LSCP_EMIT_BYTE_CODE: | 3265 | case LSCP_EMIT_BYTE_CODE: |
3266 | { | 3266 | { |
3267 | #ifdef LSL_INCLUDE_DEBUG_INFO | 3267 | #ifdef LSL_INCLUDE_DEBUG_INFO |
3268 | char name[] = "not_at_target"; | 3268 | char name[] = "not_at_target"; /*Flawfinder: ignore*/ |
3269 | chunk->addBytes(name, strlen(name) + 1); | 3269 | chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/ |
3270 | #endif | 3270 | #endif |
3271 | } | 3271 | } |
3272 | break; | 3272 | break; |
@@ -3346,10 +3346,10 @@ void LLScriptAtRotTarget::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompil | |||
3346 | { | 3346 | { |
3347 | #ifdef LSL_INCLUDE_DEBUG_INFO | 3347 | #ifdef LSL_INCLUDE_DEBUG_INFO |
3348 | char name[] = "at_rot_target"; | 3348 | char name[] = "at_rot_target"; |
3349 | chunk->addBytes(name, strlen(name) + 1); | 3349 | chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/ |
3350 | chunk->addBytes(mTargetNumber->mName, strlen(mTargetNumber->mName) + 1); | 3350 | chunk->addBytes(mTargetNumber->mName, strlen(mTargetNumber->mName) + 1); /*Flawfinder: ignore*/ |
3351 | chunk->addBytes(mTargetRotation->mName, strlen(mTargetRotation->mName) + 1); | 3351 | chunk->addBytes(mTargetRotation->mName, strlen(mTargetRotation->mName) + 1); /*Flawfinder: ignore*/ |
3352 | chunk->addBytes(mOurRotation->mName, strlen(mOurRotation->mName) + 1); | 3352 | chunk->addBytes(mOurRotation->mName, strlen(mOurRotation->mName) + 1); /*Flawfinder: ignore*/ |
3353 | #endif | 3353 | #endif |
3354 | } | 3354 | } |
3355 | break; | 3355 | break; |
@@ -3388,7 +3388,7 @@ void LLScriptNotAtRotTarget::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCom | |||
3388 | { | 3388 | { |
3389 | #ifdef LSL_INCLUDE_DEBUG_INFO | 3389 | #ifdef LSL_INCLUDE_DEBUG_INFO |
3390 | char name[] = "not_at_rot_target"; | 3390 | char name[] = "not_at_rot_target"; |
3391 | chunk->addBytes(name, strlen(name) + 1); | 3391 | chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/ |
3392 | #endif | 3392 | #endif |
3393 | } | 3393 | } |
3394 | break; | 3394 | break; |
@@ -7143,7 +7143,7 @@ void LLScriptFunctionCall::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompi | |||
7143 | gErrorToText.writeError(fp, this, LSERROR_FUNCTION_TYPE_ERROR); | 7143 | gErrorToText.writeError(fp, this, LSERROR_FUNCTION_TYPE_ERROR); |
7144 | } | 7144 | } |
7145 | } | 7145 | } |
7146 | else if (argcount != strlen(mIdentifier->mScopeEntry->mFunctionArgs.mString)) | 7146 | else if (argcount != strlen(mIdentifier->mScopeEntry->mFunctionArgs.mString)) /*Flawfinder: ignore*/ |
7147 | { | 7147 | { |
7148 | gErrorToText.writeError(fp, this, LSERROR_FUNCTION_TYPE_ERROR); | 7148 | gErrorToText.writeError(fp, this, LSERROR_FUNCTION_TYPE_ERROR); |
7149 | } | 7149 | } |
@@ -7459,7 +7459,7 @@ void add_exit_pops(LLScriptByteCodeChunk *chunk, LLScriptScopeEntry *entry) | |||
7459 | 7459 | ||
7460 | if (entry->mLocals.mString) | 7460 | if (entry->mLocals.mString) |
7461 | { | 7461 | { |
7462 | number = (S32)strlen(entry->mLocals.mString); | 7462 | number = (S32)strlen(entry->mLocals.mString); /*Flawfinder: ignore*/ |
7463 | for (i = number - 1; i >= 0; i--) | 7463 | for (i = number - 1; i >= 0; i--) |
7464 | { | 7464 | { |
7465 | switch(entry->mLocals.getType(i)) | 7465 | switch(entry->mLocals.getType(i)) |
@@ -7492,7 +7492,7 @@ void add_exit_pops(LLScriptByteCodeChunk *chunk, LLScriptScopeEntry *entry) | |||
7492 | 7492 | ||
7493 | if (entry->mFunctionArgs.mString) | 7493 | if (entry->mFunctionArgs.mString) |
7494 | { | 7494 | { |
7495 | number = (S32)strlen(entry->mFunctionArgs.mString); | 7495 | number = (S32)strlen(entry->mFunctionArgs.mString); /*Flawfinder: ignore*/ |
7496 | for (i = number - 1; i >= 0; i--) | 7496 | for (i = number - 1; i >= 0; i--) |
7497 | { | 7497 | { |
7498 | switch(entry->mFunctionArgs.getType(i)) | 7498 | switch(entry->mFunctionArgs.getType(i)) |
@@ -7531,7 +7531,7 @@ void print_exit_pops(FILE *fp, LLScriptScopeEntry *entry) | |||
7531 | 7531 | ||
7532 | if (entry->mLocals.mString) | 7532 | if (entry->mLocals.mString) |
7533 | { | 7533 | { |
7534 | number = (S32)strlen(entry->mLocals.mString); | 7534 | number = (S32)strlen(entry->mLocals.mString); /*Flawfinder: ignore*/ |
7535 | for (i = number - 1; i >= 0; i--) | 7535 | for (i = number - 1; i >= 0; i--) |
7536 | { | 7536 | { |
7537 | fprintf(fp, "%s", LSCRIPTTypePop[entry->mLocals.getType(i)]); | 7537 | fprintf(fp, "%s", LSCRIPTTypePop[entry->mLocals.getType(i)]); |
@@ -7540,7 +7540,7 @@ void print_exit_pops(FILE *fp, LLScriptScopeEntry *entry) | |||
7540 | 7540 | ||
7541 | if (entry->mFunctionArgs.mString) | 7541 | if (entry->mFunctionArgs.mString) |
7542 | { | 7542 | { |
7543 | number = (S32)strlen(entry->mFunctionArgs.mString); | 7543 | number = (S32)strlen(entry->mFunctionArgs.mString); /*Flawfinder: ignore*/ |
7544 | for (i = number - 1; i >= 0; i--) | 7544 | for (i = number - 1; i >= 0; i--) |
7545 | { | 7545 | { |
7546 | fprintf(fp, "%s", LSCRIPTTypePop[entry->mFunctionArgs.getType(i)]); | 7546 | fprintf(fp, "%s", LSCRIPTTypePop[entry->mFunctionArgs.getType(i)]); |
@@ -7985,8 +7985,8 @@ void LLScriptIf::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePass pas | |||
7985 | break; | 7985 | break; |
7986 | case LSCP_EMIT_BYTE_CODE: | 7986 | case LSCP_EMIT_BYTE_CODE: |
7987 | { | 7987 | { |
7988 | char jumpname[32]; | 7988 | char jumpname[32]; /*Flawfinder: ignore*/ |
7989 | sprintf(jumpname, "##Temp Jump %d##", gTempJumpCount++); | 7989 | snprintf(jumpname, sizeof(jumpname),"##Temp Jump %d##", gTempJumpCount++); /*Flawfinder: ignore*/ |
7990 | 7990 | ||
7991 | mExpression->recurse(fp, tabs, tabsize, LSCP_TO_STACK, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL); | 7991 | mExpression->recurse(fp, tabs, tabsize, LSCP_TO_STACK, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL); |
7992 | chunk->addByte(LSCRIPTOpCodes[LOPC_JUMPNIF]); | 7992 | chunk->addByte(LSCRIPTOpCodes[LOPC_JUMPNIF]); |
@@ -8066,10 +8066,10 @@ void LLScriptIfElse::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePass | |||
8066 | break; | 8066 | break; |
8067 | case LSCP_EMIT_BYTE_CODE: | 8067 | case LSCP_EMIT_BYTE_CODE: |
8068 | { | 8068 | { |
8069 | char jumpname1[32]; | 8069 | char jumpname1[32]; /*Flawfinder: ignore*/ |
8070 | sprintf(jumpname1, "##Temp Jump %d##", gTempJumpCount++); | 8070 | snprintf(jumpname1, sizeof(jumpname1), "##Temp Jump %d##", gTempJumpCount++); /*Flawfinder: ignore*/ |
8071 | char jumpname2[32]; | 8071 | char jumpname2[32]; /*Flawfinder: ignore*/ |
8072 | sprintf(jumpname2, "##Temp Jump %d##", gTempJumpCount++); | 8072 | snprintf(jumpname2, sizeof(jumpname2), "##Temp Jump %d##", gTempJumpCount++); /*Flawfinder: ignore*/ |
8073 | 8073 | ||
8074 | mExpression->recurse(fp, tabs, tabsize, LSCP_TO_STACK, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL); | 8074 | mExpression->recurse(fp, tabs, tabsize, LSCP_TO_STACK, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL); |
8075 | chunk->addByte(LSCRIPTOpCodes[LOPC_JUMPNIF]); | 8075 | chunk->addByte(LSCRIPTOpCodes[LOPC_JUMPNIF]); |
@@ -8169,10 +8169,10 @@ void LLScriptFor::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePass pa | |||
8169 | break; | 8169 | break; |
8170 | case LSCP_EMIT_BYTE_CODE: | 8170 | case LSCP_EMIT_BYTE_CODE: |
8171 | { | 8171 | { |
8172 | char jumpname1[32]; | 8172 | char jumpname1[32]; /*Flawfinder: ignore*/ |
8173 | sprintf(jumpname1, "##Temp Jump %d##", gTempJumpCount++); | 8173 | snprintf(jumpname1, sizeof(jumpname1), "##Temp Jump %d##", gTempJumpCount++); /*Flawfinder: ignore*/ |
8174 | char jumpname2[32]; | 8174 | char jumpname2[32]; /*Flawfinder: ignore*/ |
8175 | sprintf(jumpname2, "##Temp Jump %d##", gTempJumpCount++); | 8175 | snprintf(jumpname2, sizeof(jumpname2), "##Temp Jump %d##", gTempJumpCount++); /*Flawfinder: ignore*/ |
8176 | 8176 | ||
8177 | if(mSequence) | 8177 | if(mSequence) |
8178 | mSequence->recurse(fp, tabs, tabsize, LSCP_TO_STACK, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL); | 8178 | mSequence->recurse(fp, tabs, tabsize, LSCP_TO_STACK, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL); |
@@ -8266,8 +8266,8 @@ void LLScriptDoWhile::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePas | |||
8266 | break; | 8266 | break; |
8267 | case LSCP_EMIT_BYTE_CODE: | 8267 | case LSCP_EMIT_BYTE_CODE: |
8268 | { | 8268 | { |
8269 | char jumpname1[32]; | 8269 | char jumpname1[32]; /*Flawfinder: ignore*/ |
8270 | sprintf(jumpname1, "##Temp Jump %d##", gTempJumpCount++); | 8270 | snprintf(jumpname1, sizeof(jumpname1), "##Temp Jump %d##", gTempJumpCount++); /*Flawfinder: ignore*/ |
8271 | 8271 | ||
8272 | chunk->addLabel(jumpname1); | 8272 | chunk->addLabel(jumpname1); |
8273 | mStatement->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL); | 8273 | mStatement->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL); |
@@ -8340,10 +8340,10 @@ void LLScriptWhile::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePass | |||
8340 | break; | 8340 | break; |
8341 | case LSCP_EMIT_BYTE_CODE: | 8341 | case LSCP_EMIT_BYTE_CODE: |
8342 | { | 8342 | { |
8343 | char jumpname1[32]; | 8343 | char jumpname1[32]; /*Flawfinder: ignore*/ |
8344 | sprintf(jumpname1, "##Temp Jump %d##", gTempJumpCount++); | 8344 | snprintf(jumpname1, sizeof(jumpname1), "##Temp Jump %d##", gTempJumpCount++); /*Flawfinder: ignore*/ |
8345 | char jumpname2[32]; | 8345 | char jumpname2[32]; /*Flawfinder: ignore*/ |
8346 | sprintf(jumpname2, "##Temp Jump %d##", gTempJumpCount++); | 8346 | snprintf(jumpname2, sizeof(jumpname2), "##Temp Jump %d##", gTempJumpCount++); /*Flawfinder: ignore*/ |
8347 | 8347 | ||
8348 | chunk->addLabel(jumpname1); | 8348 | chunk->addLabel(jumpname1); |
8349 | mExpression->recurse(fp, tabs, tabsize, LSCP_TO_STACK, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL); | 8349 | mExpression->recurse(fp, tabs, tabsize, LSCP_TO_STACK, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL); |
@@ -9018,7 +9018,7 @@ void LLScriptEventHandler::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompi | |||
9018 | fprintf(fp, ".method public hidebysig instance default void "); | 9018 | fprintf(fp, ".method public hidebysig instance default void "); |
9019 | 9019 | ||
9020 | // Mangle event handler name by prefixing it with state name. Allows state changing by finding handlers prefixed with new state name. | 9020 | // Mangle event handler name by prefixing it with state name. Allows state changing by finding handlers prefixed with new state name. |
9021 | fprintf(fp, entry->mIdentifier); | 9021 | fprintf(fp, entry->mIdentifier); /*Flawfinder: ignore*/ |
9022 | 9022 | ||
9023 | // Handler name and arguments. | 9023 | // Handler name and arguments. |
9024 | mEventp->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL); | 9024 | mEventp->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL); |
@@ -9154,7 +9154,7 @@ void LLScriptFunctionDec::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompil | |||
9154 | chunk->addBytes(&typereturn, 1); | 9154 | chunk->addBytes(&typereturn, 1); |
9155 | // name | 9155 | // name |
9156 | #ifdef LSL_INCLUDE_DEBUG_INFO | 9156 | #ifdef LSL_INCLUDE_DEBUG_INFO |
9157 | chunk->addBytes(mIdentifier->mName, strlen(mIdentifier->mName) + 1); | 9157 | chunk->addBytes(mIdentifier->mName, strlen(mIdentifier->mName) + 1); /*Flawfinder: ignore*/ |
9158 | #else | 9158 | #else |
9159 | chunk->addBytes(1); | 9159 | chunk->addBytes(1); |
9160 | #endif | 9160 | #endif |
@@ -9391,7 +9391,7 @@ void LLScriptGlobalFunctions::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCo | |||
9391 | 9391 | ||
9392 | // null terminated function name | 9392 | // null terminated function name |
9393 | #ifdef LSL_INCLUDE_DEBUG_INFO | 9393 | #ifdef LSL_INCLUDE_DEBUG_INFO |
9394 | chunk->addBytes(mIdentifier->mName, strlen(mIdentifier->mName) + 1); | 9394 | chunk->addBytes(mIdentifier->mName, strlen(mIdentifier->mName) + 1); /*Flawfinder: ignore*/ |
9395 | #else | 9395 | #else |
9396 | chunk->addBytes(1); | 9396 | chunk->addBytes(1); |
9397 | #endif | 9397 | #endif |
@@ -9642,7 +9642,7 @@ void LLScriptState::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePass | |||
9642 | 9642 | ||
9643 | // null terminated state name | 9643 | // null terminated state name |
9644 | #ifdef LSL_INCLUDE_DEBUG_INFO | 9644 | #ifdef LSL_INCLUDE_DEBUG_INFO |
9645 | chunk->addBytes(mIdentifier->mName, strlen(mIdentifier->mName) + 1); | 9645 | chunk->addBytes(mIdentifier->mName, strlen(mIdentifier->mName) + 1); /*Flawfinder: ignore*/ |
9646 | #else | 9646 | #else |
9647 | chunk->addBytes(1); | 9647 | chunk->addBytes(1); |
9648 | #endif | 9648 | #endif |
@@ -9697,8 +9697,8 @@ LLScriptScript::LLScriptScript(LLScritpGlobalStorage *globals, | |||
9697 | mStates(states), mGlobalScope(NULL), mGlobals(NULL), mGlobalFunctions(NULL), mGodLike(FALSE) | 9697 | mStates(states), mGlobalScope(NULL), mGlobals(NULL), mGlobalFunctions(NULL), mGodLike(FALSE) |
9698 | { | 9698 | { |
9699 | const char DEFAULT_BYTECODE_FILENAME[] = "lscript.lso"; | 9699 | const char DEFAULT_BYTECODE_FILENAME[] = "lscript.lso"; |
9700 | strcpy(mBytecodeDest, DEFAULT_BYTECODE_FILENAME); | 9700 | strncpy(mBytecodeDest, DEFAULT_BYTECODE_FILENAME, sizeof(mBytecodeDest) -1); /*Flawfinder: ignore*/ |
9701 | 9701 | mBytecodeDest[MAX_STRING-1] = '\0'; | |
9702 | LLScriptGlobalVariable *tvar; | 9702 | LLScriptGlobalVariable *tvar; |
9703 | LLScriptGlobalFunctions *tfunc; | 9703 | LLScriptGlobalFunctions *tfunc; |
9704 | LLScritpGlobalStorage *temp; | 9704 | LLScritpGlobalStorage *temp; |
@@ -9744,7 +9744,7 @@ LLScriptScript::LLScriptScript(LLScritpGlobalStorage *globals, | |||
9744 | 9744 | ||
9745 | void LLScriptScript::setBytecodeDest(const char* dst_filename) | 9745 | void LLScriptScript::setBytecodeDest(const char* dst_filename) |
9746 | { | 9746 | { |
9747 | strncpy(mBytecodeDest, dst_filename, MAX_STRING); | 9747 | strncpy(mBytecodeDest, dst_filename, MAX_STRING); /*Flawfinder: ignore*/ |
9748 | mBytecodeDest[MAX_STRING-1] = '\0'; | 9748 | mBytecodeDest[MAX_STRING-1] = '\0'; |
9749 | } | 9749 | } |
9750 | 9750 | ||
@@ -9753,7 +9753,7 @@ void print_cil_globals(FILE* fp, LLScriptGlobalVariable* global) | |||
9753 | fprintf(fp, ".field private "); | 9753 | fprintf(fp, ".field private "); |
9754 | print_cil_type(fp, global->mType->mType); | 9754 | print_cil_type(fp, global->mType->mType); |
9755 | fprintf(fp, " "); | 9755 | fprintf(fp, " "); |
9756 | fprintf(fp, global->mIdentifier->mName); | 9756 | fprintf(fp, global->mIdentifier->mName); /*Flawfinder: ignore*/ |
9757 | fprintf(fp, "\n"); | 9757 | fprintf(fp, "\n"); |
9758 | if(NULL != global->mNextp) | 9758 | if(NULL != global->mNextp) |
9759 | { | 9759 | { |
@@ -9932,7 +9932,7 @@ void LLScriptScript::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePass | |||
9932 | 9932 | ||
9933 | // now, put it all together and spit it out | 9933 | // now, put it all together and spit it out |
9934 | // we need | 9934 | // we need |
9935 | FILE *bcfp = LLFile::fopen(mBytecodeDest, "wb"); | 9935 | FILE* bcfp = LLFile::fopen(mBytecodeDest, "wb"); /*Flawfinder: ignore*/ |
9936 | 9936 | ||
9937 | code->build(fp, bcfp); | 9937 | code->build(fp, bcfp); |
9938 | fclose(bcfp); | 9938 | fclose(bcfp); |