diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llcompilequeue.cpp | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/linden/indra/newview/llcompilequeue.cpp b/linden/indra/newview/llcompilequeue.cpp index e42677d..c5ad2b9 100644 --- a/linden/indra/newview/llcompilequeue.cpp +++ b/linden/indra/newview/llcompilequeue.cpp | |||
@@ -197,8 +197,8 @@ void LLFloaterScriptQueue::addObject(const LLUUID& id) | |||
197 | BOOL LLFloaterScriptQueue::start() | 197 | BOOL LLFloaterScriptQueue::start() |
198 | { | 198 | { |
199 | //llinfos << "LLFloaterCompileQueue::start()" << llendl; | 199 | //llinfos << "LLFloaterCompileQueue::start()" << llendl; |
200 | char buffer[MAX_STRING]; | 200 | char buffer[MAX_STRING]; /*Flawfinder: ignore*/ |
201 | sprintf(buffer, "Starting %s of %d items.", mStartString, mObjectIDs.count()); | 201 | snprintf(buffer, sizeof(buffer), "Starting %s of %d items.", mStartString, mObjectIDs.count()); /*Flawfinder: ignore*/ |
202 | 202 | ||
203 | LLScrollListCtrl* list = LLUICtrlFactory::getScrollListByName(this, "queue output"); | 203 | LLScrollListCtrl* list = LLUICtrlFactory::getScrollListByName(this, "queue output"); |
204 | list->addSimpleItem(buffer); | 204 | list->addSimpleItem(buffer); |
@@ -237,8 +237,8 @@ BOOL LLFloaterScriptQueue::nextObject() | |||
237 | LLScrollListCtrl* list = LLUICtrlFactory::getScrollListByName(this, "queue output"); | 237 | LLScrollListCtrl* list = LLUICtrlFactory::getScrollListByName(this, "queue output"); |
238 | 238 | ||
239 | mDone = TRUE; | 239 | mDone = TRUE; |
240 | char buffer[MAX_STRING]; | 240 | char buffer[MAX_STRING]; /*Flawfinder: ignore*/ |
241 | sprintf(buffer, "Done."); | 241 | snprintf(buffer, sizeof(buffer), "Done."); /*Flawfinder: ignore*/ |
242 | list->addSimpleItem(buffer); | 242 | list->addSimpleItem(buffer); |
243 | childSetEnabled("close",TRUE); | 243 | childSetEnabled("close",TRUE); |
244 | } | 244 | } |
@@ -287,7 +287,7 @@ LLFloaterCompileQueue* LLFloaterCompileQueue::create() | |||
287 | rect.translate(left - rect.mLeft, top - rect.mTop); | 287 | rect.translate(left - rect.mLeft, top - rect.mTop); |
288 | LLFloaterCompileQueue* new_queue = new LLFloaterCompileQueue("queue", | 288 | LLFloaterCompileQueue* new_queue = new LLFloaterCompileQueue("queue", |
289 | rect); | 289 | rect); |
290 | new_queue->open(); | 290 | new_queue->open(); /*Flawfinder: ignore*/ |
291 | return new_queue; | 291 | return new_queue; |
292 | } | 292 | } |
293 | 293 | ||
@@ -372,25 +372,25 @@ void LLFloaterCompileQueue::scriptArrived(LLVFS *vfs, const LLUUID& asset_id, | |||
372 | if(!data) return; | 372 | if(!data) return; |
373 | LLFloaterCompileQueue* queue = static_cast<LLFloaterCompileQueue*> | 373 | LLFloaterCompileQueue* queue = static_cast<LLFloaterCompileQueue*> |
374 | (LLFloaterScriptQueue::findInstance(data->mQueueID)); | 374 | (LLFloaterScriptQueue::findInstance(data->mQueueID)); |
375 | char buffer[MAX_STRING]; | 375 | char buffer[MAX_STRING]; /*Flawfinder: ignore*/ |
376 | buffer[0] = '\0'; | 376 | buffer[0] = '\0'; |
377 | if(queue && (0 == status)) | 377 | if(queue && (0 == status)) |
378 | { | 378 | { |
379 | //llinfos << "ITEM NAME 3: " << data->mScriptName << llendl; | 379 | //llinfos << "ITEM NAME 3: " << data->mScriptName << llendl; |
380 | 380 | ||
381 | // Dump this into a file on the local disk so we can compile it. | 381 | // Dump this into a file on the local disk so we can compile it. |
382 | char filename[LL_MAX_PATH] = ""; | 382 | char filename[LL_MAX_PATH] = ""; /*Flawfinder: ignore*/ |
383 | LLVFile file(vfs, asset_id, type); | 383 | LLVFile file(vfs, asset_id, type); |
384 | char uuid_str[UUID_STR_LENGTH]; | 384 | char uuid_str[UUID_STR_LENGTH]; /*Flawfinder: ignore*/ |
385 | asset_id.toString(uuid_str); | 385 | asset_id.toString(uuid_str); |
386 | sprintf(filename,"%s.%s",gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_str).c_str(),LLAssetType::lookup(type)); | 386 | snprintf(filename, sizeof(filename), "%s.%s",gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_str).c_str(),LLAssetType::lookup(type)); /*Flawfinder: ignore*/ |
387 | 387 | ||
388 | FILE *fp = LLFile::fopen(filename, "wb"); | 388 | FILE *fp = LLFile::fopen(filename, "wb"); /*Flawfinder: ignore*/ |
389 | if (fp) | 389 | if (fp) |
390 | { | 390 | { |
391 | const S32 buf_size = 65536; | 391 | const S32 buf_size = 65536; |
392 | U8 copy_buf[buf_size]; | 392 | U8 copy_buf[buf_size]; |
393 | while (file.read(copy_buf, buf_size)) | 393 | while (file.read(copy_buf, buf_size)) /*Flawfinder: ignore*/ |
394 | { | 394 | { |
395 | if (fwrite(copy_buf, file.getLastBytesRead(), 1, fp) < 1) | 395 | if (fwrite(copy_buf, file.getLastBytesRead(), 1, fp) < 1) |
396 | { | 396 | { |
@@ -403,7 +403,7 @@ void LLFloaterCompileQueue::scriptArrived(LLVFS *vfs, const LLUUID& asset_id, | |||
403 | } | 403 | } |
404 | 404 | ||
405 | // It's now in the file, now compile it. | 405 | // It's now in the file, now compile it. |
406 | sprintf(buffer, "Downloaded, now compiling '%s'.", data->mScriptName.c_str()); | 406 | snprintf(buffer, sizeof(buffer), "Downloaded, now compiling '%s'.", data->mScriptName.c_str()); /*Flawfinder: ignore*/ |
407 | queue->compile(filename, asset_id); | 407 | queue->compile(filename, asset_id); |
408 | 408 | ||
409 | // Delete it after we're done compiling? | 409 | // Delete it after we're done compiling? |
@@ -420,19 +420,19 @@ void LLFloaterCompileQueue::scriptArrived(LLVFS *vfs, const LLUUID& asset_id, | |||
420 | { | 420 | { |
421 | LLChat chat("Script not found on server."); | 421 | LLChat chat("Script not found on server."); |
422 | LLFloaterChat::addChat(chat); | 422 | LLFloaterChat::addChat(chat); |
423 | sprintf(buffer, "Problem downloading %s.", | 423 | snprintf(buffer, sizeof(buffer), "Problem downloading %s.", /*Flawfinder: ignore*/ |
424 | data->mScriptName.c_str()); | 424 | data->mScriptName.c_str()); |
425 | } | 425 | } |
426 | else if (LL_ERR_INSUFFICIENT_PERMISSIONS == status) | 426 | else if (LL_ERR_INSUFFICIENT_PERMISSIONS == status) |
427 | { | 427 | { |
428 | LLChat chat("Insufficient permissions to download a script."); | 428 | LLChat chat("Insufficient permissions to download a script."); |
429 | LLFloaterChat::addChat(chat); | 429 | LLFloaterChat::addChat(chat); |
430 | sprintf(buffer, "Insufficient permissions for '%s'.", | 430 | snprintf(buffer, sizeof(buffer), "Insufficient permissions for '%s'.", /*Flawfinder: ignore*/ |
431 | data->mScriptName.c_str()); | 431 | data->mScriptName.c_str()); |
432 | } | 432 | } |
433 | else | 433 | else |
434 | { | 434 | { |
435 | sprintf(buffer, "Unknown failure to download %s.", | 435 | snprintf(buffer, sizeof(buffer), "Unknown failure to download %s.", /*Flawfinder: ignore*/ |
436 | data->mScriptName.c_str()); | 436 | data->mScriptName.c_str()); |
437 | } | 437 | } |
438 | 438 | ||
@@ -493,12 +493,12 @@ void LLFloaterCompileQueue::compile(const char* filename, | |||
493 | tid.generate(); | 493 | tid.generate(); |
494 | new_asset_id = tid.makeAssetID(gAgent.getSecureSessionID()); | 494 | new_asset_id = tid.makeAssetID(gAgent.getSecureSessionID()); |
495 | 495 | ||
496 | char uuid_string[UUID_STR_LENGTH]; | 496 | char uuid_string[UUID_STR_LENGTH]; /*Flawfinder: ignore*/ |
497 | new_asset_id.toString(uuid_string); | 497 | new_asset_id.toString(uuid_string); |
498 | char dst_filename[LL_MAX_PATH]; | 498 | char dst_filename[LL_MAX_PATH]; /*Flawfinder: ignore*/ |
499 | sprintf(dst_filename, "%s.lso", gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_string).c_str()); | 499 | snprintf(dst_filename, sizeof(dst_filename), "%s.lso", gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_string).c_str()); /*Flawfinder: ignore*/ |
500 | char err_filename[LL_MAX_PATH]; | 500 | char err_filename[LL_MAX_PATH]; /*Flawfinder: ignore*/ |
501 | sprintf(err_filename, "%s.out", gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_string).c_str()); | 501 | snprintf(err_filename, sizeof(err_filename), "%s.out", gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_string).c_str()); /*Flawfinder: ignore*/ |
502 | 502 | ||
503 | gAssetStorage->storeAssetData(filename, tid, | 503 | gAssetStorage->storeAssetData(filename, tid, |
504 | LLAssetType::AT_LSL_TEXT, | 504 | LLAssetType::AT_LSL_TEXT, |
@@ -590,7 +590,7 @@ LLFloaterResetQueue* LLFloaterResetQueue::create() | |||
590 | rect.translate(left - rect.mLeft, top - rect.mTop); | 590 | rect.translate(left - rect.mLeft, top - rect.mTop); |
591 | LLFloaterResetQueue* new_queue = new LLFloaterResetQueue("queue", | 591 | LLFloaterResetQueue* new_queue = new LLFloaterResetQueue("queue", |
592 | rect); | 592 | rect); |
593 | new_queue->open(); | 593 | new_queue->open(); /*Flawfinder: ignore*/ |
594 | return new_queue; | 594 | return new_queue; |
595 | } | 595 | } |
596 | 596 | ||
@@ -621,8 +621,8 @@ void LLFloaterResetQueue::handleInventory(LLViewerObject* viewer_obj, | |||
621 | { | 621 | { |
622 | LLInventoryItem* item = (LLInventoryItem*)((LLInventoryObject*)(*it)); | 622 | LLInventoryItem* item = (LLInventoryItem*)((LLInventoryObject*)(*it)); |
623 | LLScrollListCtrl* list = LLUICtrlFactory::getScrollListByName(this, "queue output"); | 623 | LLScrollListCtrl* list = LLUICtrlFactory::getScrollListByName(this, "queue output"); |
624 | char buffer[MAX_STRING]; | 624 | char buffer[MAX_STRING]; /*Flawfinder: ignore*/ |
625 | sprintf(buffer, "Resetting '%s'.", item->getName().c_str()); | 625 | snprintf(buffer, sizeof(buffer), "Resetting '%s'.", item->getName().c_str()); /*Flawfinder: ignore*/ |
626 | list->addSimpleItem(buffer); | 626 | list->addSimpleItem(buffer); |
627 | LLMessageSystem* msg = gMessageSystem; | 627 | LLMessageSystem* msg = gMessageSystem; |
628 | msg->newMessageFast(_PREHASH_ScriptReset); | 628 | msg->newMessageFast(_PREHASH_ScriptReset); |
@@ -653,7 +653,7 @@ LLFloaterRunQueue* LLFloaterRunQueue::create() | |||
653 | rect.translate(left - rect.mLeft, top - rect.mTop); | 653 | rect.translate(left - rect.mLeft, top - rect.mTop); |
654 | LLFloaterRunQueue* new_queue = new LLFloaterRunQueue("queue", | 654 | LLFloaterRunQueue* new_queue = new LLFloaterRunQueue("queue", |
655 | rect); | 655 | rect); |
656 | new_queue->open(); | 656 | new_queue->open(); /*Flawfinder: ignore*/ |
657 | return new_queue; | 657 | return new_queue; |
658 | } | 658 | } |
659 | 659 | ||
@@ -684,8 +684,8 @@ void LLFloaterRunQueue::handleInventory(LLViewerObject* viewer_obj, | |||
684 | { | 684 | { |
685 | LLInventoryItem* item = (LLInventoryItem*)((LLInventoryObject*)(*it)); | 685 | LLInventoryItem* item = (LLInventoryItem*)((LLInventoryObject*)(*it)); |
686 | LLScrollListCtrl* list = LLUICtrlFactory::getScrollListByName(this, "queue output"); | 686 | LLScrollListCtrl* list = LLUICtrlFactory::getScrollListByName(this, "queue output"); |
687 | char buffer[MAX_STRING]; | 687 | char buffer[MAX_STRING]; /*Flawfinder: ignore*/ |
688 | sprintf(buffer, "Running '%s'.", item->getName().c_str()); | 688 | snprintf(buffer, sizeof(buffer), "Running '%s'.", item->getName().c_str()); /*Flawfinder: ignore*/ |
689 | list->addSimpleItem(buffer); | 689 | list->addSimpleItem(buffer); |
690 | 690 | ||
691 | LLMessageSystem* msg = gMessageSystem; | 691 | LLMessageSystem* msg = gMessageSystem; |
@@ -718,7 +718,7 @@ LLFloaterNotRunQueue* LLFloaterNotRunQueue::create() | |||
718 | rect.translate(left - rect.mLeft, top - rect.mTop); | 718 | rect.translate(left - rect.mLeft, top - rect.mTop); |
719 | LLFloaterNotRunQueue* new_queue = new LLFloaterNotRunQueue("queue", | 719 | LLFloaterNotRunQueue* new_queue = new LLFloaterNotRunQueue("queue", |
720 | rect); | 720 | rect); |
721 | new_queue->open(); | 721 | new_queue->open(); /*Flawfinder: ignore*/ |
722 | return new_queue; | 722 | return new_queue; |
723 | } | 723 | } |
724 | 724 | ||
@@ -749,8 +749,8 @@ void LLFloaterNotRunQueue::handleInventory(LLViewerObject* viewer_obj, | |||
749 | { | 749 | { |
750 | LLInventoryItem* item = (LLInventoryItem*)((LLInventoryObject*)(*it)); | 750 | LLInventoryItem* item = (LLInventoryItem*)((LLInventoryObject*)(*it)); |
751 | LLScrollListCtrl* list = LLUICtrlFactory::getScrollListByName(this, "queue output"); | 751 | LLScrollListCtrl* list = LLUICtrlFactory::getScrollListByName(this, "queue output"); |
752 | char buffer[MAX_STRING]; | 752 | char buffer[MAX_STRING]; /*Flawfinder: ignore*/ |
753 | sprintf(buffer, "Not running '%s'.", item->getName().c_str()); | 753 | snprintf(buffer, sizeof(buffer), "Not running '%s'.", item->getName().c_str()); /*Flawfinder: ignore*/ |
754 | list->addSimpleItem(buffer); | 754 | list->addSimpleItem(buffer); |
755 | 755 | ||
756 | LLMessageSystem* msg = gMessageSystem; | 756 | LLMessageSystem* msg = gMessageSystem; |