summaryrefslogtreecommitdiff
path: root/indra/llmessage/llxfer_file.cpp
diff options
context:
space:
mode:
authorDon Kjer <don@lindenlab.com>2007-05-02 21:24:47 +0000
committerDon Kjer <don@lindenlab.com>2007-05-02 21:24:47 +0000
commit1c909afe3998778e4cc045c9ab733e8afbf7c25b (patch)
tree75c00a32a8e305280cbec253195d1113d628fc3e /indra/llmessage/llxfer_file.cpp
parentbc59c04653bf1404e8148a8169208b146a123b28 (diff)
svn merge -r 60342:61148 svn+ssh://svn/svn/linden/branches/maintenance into release
Diffstat (limited to 'indra/llmessage/llxfer_file.cpp')
-rw-r--r--indra/llmessage/llxfer_file.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/indra/llmessage/llxfer_file.cpp b/indra/llmessage/llxfer_file.cpp
index 14c266950d..299c043d93 100644
--- a/indra/llmessage/llxfer_file.cpp
+++ b/indra/llmessage/llxfer_file.cpp
@@ -62,7 +62,8 @@ void LLXfer_File::init (const LLString& local_filename, BOOL delete_local_on_com
if (!local_filename.empty())
{
- strncpy(mLocalFilename, local_filename.c_str(), LL_MAX_PATH); /* Flawfinder : ignore */
+ strncpy(mLocalFilename, local_filename.c_str(), LL_MAX_PATH-1);
+ mLocalFilename[LL_MAX_PATH-1] = '\0'; // stupid strncpy.
// You can only automatically delete .tmp file as a safeguard against nasty messages.
mDeleteLocalOnCompletion = (delete_local_on_completion && (strstr(mLocalFilename,".tmp") == &mLocalFilename[strlen(mLocalFilename)-4])); /* Flawfinder : ignore */
@@ -97,19 +98,21 @@ void LLXfer_File::free ()
///////////////////////////////////////////////////////////
S32 LLXfer_File::initializeRequest(U64 xfer_id,
- const LLString& local_filename,
- const LLString& remote_filename,
- ELLPath remote_path,
- const LLHost& remote_host,
- BOOL delete_remote_on_completion,
- void (*callback)(void**,S32),
- void** user_data)
+ const LLString& local_filename,
+ const LLString& remote_filename,
+ ELLPath remote_path,
+ const LLHost& remote_host,
+ BOOL delete_remote_on_completion,
+ void (*callback)(void**,S32),
+ void** user_data)
{
S32 retval = 0; // presume success
mID = xfer_id;
- strncpy(mLocalFilename, local_filename.c_str(), LL_MAX_PATH); /* Flawfinder : ignore */
- strncpy(mRemoteFilename,remote_filename.c_str(), LL_MAX_PATH); /* Flawfinder : ignore */
+ strncpy(mLocalFilename, local_filename.c_str(), LL_MAX_PATH-1);
+ mLocalFilename[LL_MAX_PATH-1] = '\0'; // stupid strncpy.
+ strncpy(mRemoteFilename,remote_filename.c_str(), LL_MAX_PATH-1);
+ mRemoteFilename[LL_MAX_PATH-1] = '\0'; // stupid strncpy.
mRemotePath = remote_path;
mRemoteHost = remote_host;
mDeleteRemoteOnCompletion = delete_remote_on_completion;