aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfilepicker.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llfilepicker.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/linden/indra/newview/llfilepicker.cpp b/linden/indra/newview/llfilepicker.cpp
index 971743b..24d3932 100644
--- a/linden/indra/newview/llfilepicker.cpp
+++ b/linden/indra/newview/llfilepicker.cpp
@@ -451,8 +451,9 @@ void LLFilePicker::reset()
451 451
452void LLFilePicker::buildFilename( void ) 452void LLFilePicker::buildFilename( void )
453{ 453{
454 strncpy( mFilename, mFiles, LL_MAX_PATH ); /*Flawfinder: ignore*/ 454 strncpy( mFilename, mFiles, LL_MAX_PATH );
455 S32 len = strlen( mFilename ); /*Flawfinder: ignore*/ 455 mFilename[LL_MAX_PATH-1] = '\0'; // stupid strncpy
456 S32 len = strlen( mFilename );
456 457
457 strncat(mFilename,gDirUtilp->getDirDelimiter().c_str(), sizeof(mFilename)-len+1); /*Flawfinder: ignore*/ 458 strncat(mFilename,gDirUtilp->getDirDelimiter().c_str(), sizeof(mFilename)-len+1); /*Flawfinder: ignore*/
458 len += strlen(gDirUtilp->getDirDelimiter().c_str()); /*Flawfinder: ignore*/ 459 len += strlen(gDirUtilp->getDirDelimiter().c_str()); /*Flawfinder: ignore*/
@@ -858,7 +859,10 @@ void LLFilePicker::getFilePath(SInt32 index)
858{ 859{
859 mFiles[0] = 0; 860 mFiles[0] = 0;
860 if (mFileVector.size()) 861 if (mFileVector.size())
861 strncpy(mFiles, mFileVector[index].c_str(), sizeof(mFiles)); /*Flawfinder: ignore*/ 862 {
863 strncpy(mFiles, mFileVector[index].c_str(), sizeof(mFiles));
864 mFiles[sizeof(mFiles)-1] = '\0'; // stupid strncpy
865 }
862} 866}
863 867
864void LLFilePicker::getFileName(SInt32 index) 868void LLFilePicker::getFileName(SInt32 index)
@@ -868,7 +872,10 @@ void LLFilePicker::getFileName(SInt32 index)
868 { 872 {
869 char *start = strrchr(mFileVector[index].c_str(), '/'); 873 char *start = strrchr(mFileVector[index].c_str(), '/');
870 if (start && ((start + 1 - mFileVector[index].c_str()) < (mFileVector[index].size()))) 874 if (start && ((start + 1 - mFileVector[index].c_str()) < (mFileVector[index].size())))
871 strncpy(mFilename, start + 1, sizeof(mFilename)); /*Flawfinder: ignore*/ 875 {
876 strncpy(mFilename, start + 1, sizeof(mFilename));
877 mFilename[sizeof(mFilename)-1] = '\0';// stupid strncpy
878 }
872 } 879 }
873} 880}
874 881