aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llmessage/llxfer_file.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llmessage/llxfer_file.cpp')
-rw-r--r--linden/indra/llmessage/llxfer_file.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/linden/indra/llmessage/llxfer_file.cpp b/linden/indra/llmessage/llxfer_file.cpp
index 297d163..33db248 100644
--- a/linden/indra/llmessage/llxfer_file.cpp
+++ b/linden/indra/llmessage/llxfer_file.cpp
@@ -82,7 +82,8 @@ void LLXfer_File::init (const LLString& local_filename, BOOL delete_local_on_com
82 82
83 if (!local_filename.empty()) 83 if (!local_filename.empty())
84 { 84 {
85 strncpy(mLocalFilename, local_filename.c_str(), LL_MAX_PATH); /* Flawfinder : ignore */ 85 strncpy(mLocalFilename, local_filename.c_str(), LL_MAX_PATH-1);
86 mLocalFilename[LL_MAX_PATH-1] = '\0'; // stupid strncpy.
86 87
87 // You can only automatically delete .tmp file as a safeguard against nasty messages. 88 // You can only automatically delete .tmp file as a safeguard against nasty messages.
88 mDeleteLocalOnCompletion = (delete_local_on_completion && (strstr(mLocalFilename,".tmp") == &mLocalFilename[strlen(mLocalFilename)-4])); /* Flawfinder : ignore */ 89 mDeleteLocalOnCompletion = (delete_local_on_completion && (strstr(mLocalFilename,".tmp") == &mLocalFilename[strlen(mLocalFilename)-4])); /* Flawfinder : ignore */
@@ -117,19 +118,21 @@ void LLXfer_File::free ()
117/////////////////////////////////////////////////////////// 118///////////////////////////////////////////////////////////
118 119
119S32 LLXfer_File::initializeRequest(U64 xfer_id, 120S32 LLXfer_File::initializeRequest(U64 xfer_id,
120 const LLString& local_filename, 121 const LLString& local_filename,
121 const LLString& remote_filename, 122 const LLString& remote_filename,
122 ELLPath remote_path, 123 ELLPath remote_path,
123 const LLHost& remote_host, 124 const LLHost& remote_host,
124 BOOL delete_remote_on_completion, 125 BOOL delete_remote_on_completion,
125 void (*callback)(void**,S32), 126 void (*callback)(void**,S32),
126 void** user_data) 127 void** user_data)
127{ 128{
128 S32 retval = 0; // presume success 129 S32 retval = 0; // presume success
129 130
130 mID = xfer_id; 131 mID = xfer_id;
131 strncpy(mLocalFilename, local_filename.c_str(), LL_MAX_PATH); /* Flawfinder : ignore */ 132 strncpy(mLocalFilename, local_filename.c_str(), LL_MAX_PATH-1);
132 strncpy(mRemoteFilename,remote_filename.c_str(), LL_MAX_PATH); /* Flawfinder : ignore */ 133 mLocalFilename[LL_MAX_PATH-1] = '\0'; // stupid strncpy.
134 strncpy(mRemoteFilename,remote_filename.c_str(), LL_MAX_PATH-1);
135 mRemoteFilename[LL_MAX_PATH-1] = '\0'; // stupid strncpy.
133 mRemotePath = remote_path; 136 mRemotePath = remote_path;
134 mRemoteHost = remote_host; 137 mRemoteHost = remote_host;
135 mDeleteRemoteOnCompletion = delete_remote_on_completion; 138 mDeleteRemoteOnCompletion = delete_remote_on_completion;