aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloaterimport.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llfloaterimport.cpp')
-rw-r--r--linden/indra/newview/llfloaterimport.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/linden/indra/newview/llfloaterimport.cpp b/linden/indra/newview/llfloaterimport.cpp
index b7255db..478b5d7 100644
--- a/linden/indra/newview/llfloaterimport.cpp
+++ b/linden/indra/newview/llfloaterimport.cpp
@@ -76,8 +76,9 @@ LLFloaterImport::LLFloaterImport(const std::string filename)
76{ 76{
77 mFilenameAndPath = filename; 77 mFilenameAndPath = filename;
78 78
79 char file_path[256]; 79 char file_path[256]; /*Flawfinder: ignore*/
80 strcpy(file_path, mFilenameAndPath.c_str()); 80 strncpy(file_path, mFilenameAndPath.c_str(), sizeof(file_path) -1); /*Flawfinder: ignore*/
81 file_path[sizeof(file_path) -1] = '\0';
81 char *file_name = strrchr( file_path, gDirUtilp->getDirDelimiter()[0]); 82 char *file_name = strrchr( file_path, gDirUtilp->getDirDelimiter()[0]);
82 file_name[0] = 0; 83 file_name[0] = 0;
83 84
@@ -104,7 +105,7 @@ BOOL LLFloaterImport::postBuild()
104 char* end_p = strrchr(asset_name_str, '.'); // strip extension if exists 105 char* end_p = strrchr(asset_name_str, '.'); // strip extension if exists
105 if( !end_p ) 106 if( !end_p )
106 { 107 {
107 end_p = asset_name_str + strlen( asset_name_str ); 108 end_p = asset_name_str + strlen( asset_name_str ); /*Flawfinder: ignore*/
108 } 109 }
109 110
110 S32 len = llmin( (S32) (DB_INV_ITEM_NAME_STR_LEN), (S32) (end_p - asset_name_str) ); 111 S32 len = llmin( (S32) (DB_INV_ITEM_NAME_STR_LEN), (S32) (end_p - asset_name_str) );
@@ -182,8 +183,8 @@ BOOL LLFloaterImport::postBuild()
182 LLScrollListItem *new_item = new LLScrollListItem(TRUE, task); 183 LLScrollListItem *new_item = new LLScrollListItem(TRUE, task);
183 new_item->addColumn("OBJECT", default_font, 60); 184 new_item->addColumn("OBJECT", default_font, 60);
184 LLString output_line; 185 LLString output_line;
185 char buffer[20]; 186 char buffer[20]; /*Flawfinder: ignore*/
186 sprintf(buffer, "%d", (S32)tasks_list.size()); 187 snprintf(buffer, sizeof(buffer), "%d", (S32)tasks_list.size()); /*Flawfinder: ignore*/
187 output_line.append(buffer); 188 output_line.append(buffer);
188 output_line.append(" prims"); 189 output_line.append(" prims");
189 new_item->addColumn(output_line, default_font, 80); 190 new_item->addColumn(output_line, default_font, 80);
@@ -257,9 +258,9 @@ BOOL LLFloaterImport::postBuild()
257 258
258 llinfos << "Getting hash for " << image_path << llendl; 259 llinfos << "Getting hash for " << image_path << llendl;
259 260
260 char md5_hash_string[33]; 261 char md5_hash_string[33]; /*Flawfinder: ignore*/
261 strcpy(md5_hash_string, "00000000000000000000000000000000"); 262 strcpy(md5_hash_string, "00000000000000000000000000000000"); /*Flawfinder: ignore*/
262 FILE *fCheck = LLFile::fopen(image_path.c_str(), "rb"); 263 FILE* fCheck = LLFile::fopen(image_path.c_str(), "rb"); /*Flawfinder: ignore*/
263 if (fCheck) 264 if (fCheck)
264 { 265 {
265 LLMD5 my_md5_hash(fCheck); 266 LLMD5 my_md5_hash(fCheck);
@@ -458,7 +459,7 @@ void LLFloaterImport::finishImport(ImportAssetInfo *info)
458 { 459 {
459 // Copy file into a local directory 460 // Copy file into a local directory
460 LLString new_file = "TEMP"; 461 LLString new_file = "TEMP";
461 new_file.append(new_file_id.getString()); 462 new_file.append(new_file_id.asString());
462 new_file.append(".slobject"); 463 new_file.append(".slobject");
463 464
464 S32 length; 465 S32 length;
@@ -509,7 +510,7 @@ void LLFloaterImport::asset_uploaded_callback(const LLUUID& uuid, void* user_dat
509 LLResourceData *resource_data = (LLResourceData*)user_data; 510 LLResourceData *resource_data = (LLResourceData*)user_data;
510 ImportAssetInfo *info = (ImportAssetInfo*)resource_data->mUserData; 511 ImportAssetInfo *info = (ImportAssetInfo*)resource_data->mUserData;
511 512
512 info->NewImageIDList.push_back(resource_data->mAssetInfo.mUuid.getString()); 513 info->NewImageIDList.push_back(resource_data->mAssetInfo.mUuid.asString());
513 514
514 LLUploadDialog::modalUploadFinished(); 515 LLUploadDialog::modalUploadFinished();
515 if (info->ImageFileQueue.size() == 0) 516 if (info->ImageFileQueue.size() == 0)
@@ -553,7 +554,7 @@ void LLFloaterImport::onBtnOK(void*userdata)
553 LLString *image_id = (LLString *)(*itor)->getUserdata(); 554 LLString *image_id = (LLString *)(*itor)->getUserdata();
554 if (image_id) 555 if (image_id)
555 { 556 {
556 asset_info->OldImageIDList.push_back(id.getString()); 557 asset_info->OldImageIDList.push_back(id.asString());
557 LLString image_file = fp->mInventoryPath; 558 LLString image_file = fp->mInventoryPath;
558 image_file.append(gDirUtilp->getDirDelimiter()); 559 image_file.append(gDirUtilp->getDirDelimiter());
559 image_file.append(*image_id); 560 image_file.append(*image_id);