diff options
author | Aaron Brashears <aaronb@lindenlab.com> | 2007-02-02 17:28:58 +0000 |
---|---|---|
committer | Aaron Brashears <aaronb@lindenlab.com> | 2007-02-02 17:28:58 +0000 |
commit | 305c74d5163c5e344a675d39ca2394a9e45bd2c2 (patch) | |
tree | 42836c4a6010b2b015156024d3cfb6bf64a48ad6 /indra/llmessage | |
parent | 54d89549df38bb61881583a3eb8d3645c107d79f (diff) |
Result of svn merge -r57264:57370 svn+ssh://svn/svn/linden/branches/adroit.r40-68 into release.
Diffstat (limited to 'indra/llmessage')
-rw-r--r-- | indra/llmessage/llassetstorage.cpp | 4 | ||||
-rw-r--r-- | indra/llmessage/llbuffer.cpp | 6 | ||||
-rw-r--r-- | indra/llmessage/llcachename.cpp | 21 | ||||
-rw-r--r-- | indra/llmessage/lldatapacker.cpp | 16 | ||||
-rw-r--r-- | indra/llmessage/llhost.cpp | 2 | ||||
-rw-r--r-- | indra/llmessage/llhttpassetstorage.cpp | 2 | ||||
-rw-r--r-- | indra/llmessage/llinstantmessage.cpp | 8 | ||||
-rw-r--r-- | indra/llmessage/llnamevalue.cpp | 28 | ||||
-rw-r--r-- | indra/llmessage/llpacketack.h | 2 | ||||
-rw-r--r-- | indra/llmessage/llpacketbuffer.cpp | 2 | ||||
-rw-r--r-- | indra/llmessage/llpacketring.cpp | 2 | ||||
-rw-r--r-- | indra/llmessage/lltransfermanager.cpp | 6 | ||||
-rw-r--r-- | indra/llmessage/llxfer.cpp | 6 | ||||
-rw-r--r-- | indra/llmessage/llxfer_file.cpp | 4 | ||||
-rw-r--r-- | indra/llmessage/message.cpp | 69 | ||||
-rw-r--r-- | indra/llmessage/message_string_table.cpp | 2 | ||||
-rw-r--r-- | indra/llmessage/net.cpp | 2 | ||||
-rw-r--r-- | indra/llmessage/partsyspacket.cpp | 2 |
18 files changed, 96 insertions, 88 deletions
diff --git a/indra/llmessage/llassetstorage.cpp b/indra/llmessage/llassetstorage.cpp index e2bfd0496b..4ec5ec34ec 100644 --- a/indra/llmessage/llassetstorage.cpp +++ b/indra/llmessage/llassetstorage.cpp @@ -1037,12 +1037,12 @@ void LLAssetStorage::legacyGetDataCallback(LLVFS *vfs, const LLUUID &uuid, LLAss uuid.toString(uuid_str); snprintf(filename,sizeof(filename),"%s.%s",gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_str).c_str(),LLAssetType::lookup(type)); /* Flawfinder: ignore */ - FILE *fp = LLFile::fopen(filename, "wb"); /* Flawfinder: ignore */ + FILE* fp = LLFile::fopen(filename, "wb"); /* Flawfinder: ignore */ if (fp) { const S32 buf_size = 65536; U8 copy_buf[buf_size]; - while (file.read(copy_buf, buf_size)) + while (file.read(copy_buf, buf_size)) /* Flawfinder: ignore */ { if (fwrite(copy_buf, file.getLastBytesRead(), 1, fp) < 1) { diff --git a/indra/llmessage/llbuffer.cpp b/indra/llmessage/llbuffer.cpp index 009387598b..e4200b914b 100644 --- a/indra/llmessage/llbuffer.cpp +++ b/indra/llmessage/llbuffer.cpp @@ -90,7 +90,7 @@ LLHeapBuffer::LLHeapBuffer(const U8* src, S32 len) allocate(len); if(mBuffer) { - memcpy(mBuffer, src, len); + memcpy(mBuffer, src, len); /*Flawfinder: ignore*/ } } else @@ -716,7 +716,7 @@ bool LLBufferArray::copyIntoBuffers( } segments.push_back(segment); S32 bytes = llmin(segment.size(), len); - memcpy(segment.data(), src + copied, bytes); /* Flawfinder Ignore */ + memcpy(segment.data(), src + copied, bytes); /* Flawfinder: Ignore */ copied += bytes; len -= bytes; if(0 == len) @@ -738,7 +738,7 @@ bool LLBufferArray::copyIntoBuffers( return false; } segments.push_back(segment); - memcpy(segment.data(), src + copied, segment.size()); + memcpy(segment.data(), src + copied, segment.size()); /*Flawfinder: ignore*/ copied += segment.size(); len -= segment.size(); } diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp index 2232e8642b..6841dda9a4 100644 --- a/indra/llmessage/llcachename.cpp +++ b/indra/llmessage/llcachename.cpp @@ -278,7 +278,10 @@ void LLCacheName::importFile(FILE* fp) // *NOTE: This buffer size is hardcoded into sscanf() below char version_string[BUFFER_SIZE]; /*Flawfinder: ignore*/ S32 version = 0; - S32 match = sscanf(buffer, "%1023s %d", version_string, &version); + S32 match = sscanf( /* Flawfinder: ignore */ + buffer, + "%1023s %d", + version_string, &version); if ( match != 2 || strcmp(version_string, "version") || version != CN_FILE_VERSION) @@ -297,7 +300,7 @@ void LLCacheName::importFile(FILE* fp) valid = fgets(buffer, BUFFER_SIZE, fp); if (!valid) break; - match = sscanf( + match = sscanf( /* Flawfinder: ignore */ buffer, "%254s %u %254s %254s", id_string, @@ -376,7 +379,7 @@ BOOL LLCacheName::getName(const LLUUID& id, char* first, char* last) { // The function signature needs to change to pass in the // length of first and last. - strcpy(first, CN_NOBODY); + strcpy(first, CN_NOBODY); /*Flawfinder: ignore*/ last[0] = '\0'; return FALSE; } @@ -386,8 +389,8 @@ BOOL LLCacheName::getName(const LLUUID& id, char* first, char* last) { // The function signature needs to change to pass in the // length of first and last. - strcpy(first, entry->mFirstName); - strcpy(last, entry->mLastName); + strcpy(first, entry->mFirstName); /*Flawfinder: ignore*/ + strcpy(last, entry->mLastName); /*Flawfinder: ignore*/ return TRUE; } else @@ -397,7 +400,7 @@ BOOL LLCacheName::getName(const LLUUID& id, char* first, char* last) strcpy(first,(ll_frand() < HIPPO_PROBABILITY) ? CN_HIPPOS : CN_WAITING); - strcpy(last, ""); + strcpy(last, ""); /*Flawfinder: ignore*/ impl.mAskNameQueue.push_back(id); return FALSE; @@ -413,7 +416,7 @@ BOOL LLCacheName::getGroupName(const LLUUID& id, char* group) { // The function signature needs to change to pass in the // length of first and last. - strcpy(group, CN_NONE); + strcpy(group, CN_NONE); /*Flawfinder: ignore*/ return FALSE; } @@ -431,14 +434,14 @@ BOOL LLCacheName::getGroupName(const LLUUID& id, char* group) { // The function signature needs to change to pass in the length // of group. - strcpy(group, entry->mGroupName); + strcpy(group, entry->mGroupName); /*Flawfinder: ignore*/ return TRUE; } else { // The function signature needs to change to pass in the length // of first and last. - strcpy(group, CN_WAITING); + strcpy(group, CN_WAITING); /*Flawfinder: ignore*/ impl.mAskGroupQueue.push_back(id); return FALSE; diff --git a/indra/llmessage/lldatapacker.cpp b/indra/llmessage/lldatapacker.cpp index 627f77d4d8..10929dfbb2 100644 --- a/indra/llmessage/lldatapacker.cpp +++ b/indra/llmessage/lldatapacker.cpp @@ -524,7 +524,7 @@ const LLDataPackerBinaryBuffer& LLDataPackerBinaryBuffer::operator=(const LLData // We've got problems, ack! llerrs << "Trying to do an assignment with not enough room in the target." << llendl; } - memcpy(mBufferp, a.mBufferp, a.getBufferSize()); + memcpy(mBufferp, a.mBufferp, a.getBufferSize()); /*Flawfinder: ignore*/ return *this; } @@ -1217,7 +1217,7 @@ BOOL LLDataPackerAsciiBuffer::unpackUUID(LLUUID &value, const char *name) } char tmp_str[64]; /* Flawfinder: ignore */ - sscanf(valuestr, "%63s", tmp_str); + sscanf(valuestr, "%63s", tmp_str); /* Flawfinder: ignore */ value.set(tmp_str); return success; @@ -1239,7 +1239,7 @@ void LLDataPackerAsciiBuffer::writeIndentedName(const char *name) } else { - numCopied = (S32)strlen(name) + 1; //name + tab /* Flawfinder: ignore */ + numCopied = (S32)strlen(name) + 1; /* Flawfinder: ignore */ //name + tab } // snprintf returns number of bytes that would have been written had the @@ -1269,9 +1269,9 @@ BOOL LLDataPackerAsciiBuffer::getValueStr(const char *name, char *out_value, S32 // Read both the name and the value, and validate the name. sscanf(mCurBufferp, "%511[^\n]", buffer); // Skip the \n - mCurBufferp += (S32)strlen(buffer) + 1; + mCurBufferp += (S32)strlen(buffer) + 1; /* Flawfinder: ignore */ - sscanf(buffer, "%511s %511[^\n]", keyword, value); + sscanf(buffer, "%511s %511[^\n]", keyword, value); /* Flawfinder: ignore */ if (strcmp(keyword, name)) { @@ -1775,7 +1775,7 @@ BOOL LLDataPackerAsciiFile::unpackUUID(LLUUID &value, const char *name) } char tmp_str[64]; /*Flawfinder: ignore */ - sscanf(valuestr,"%63s",tmp_str); + sscanf(valuestr,"%63s",tmp_str); /* Flawfinder: ignore */ value.set(tmp_str); return success; @@ -1819,7 +1819,7 @@ BOOL LLDataPackerAsciiFile::getValueStr(const char *name, char *out_value, S32 v fgetpos(mFP, &last_pos); fgets(buffer, DP_BUFSIZE, mFP); - sscanf(buffer, "%511s %511[^\n]", keyword, value); + sscanf(buffer, "%511s %511[^\n]", keyword, value); /* Flawfinder: ignore */ if (!keyword[0]) { @@ -1844,7 +1844,7 @@ BOOL LLDataPackerAsciiFile::getValueStr(const char *name, char *out_value, S32 v { mInputStream->getline(buffer, DP_BUFSIZE); - sscanf(buffer, "%511s %511[^\n]", keyword, value); + sscanf(buffer, "%511s %511[^\n]", keyword, value); /* Flawfinder: ignore */ if (!keyword[0]) { llwarns << "Data packer could not get the keyword!" << llendl; diff --git a/indra/llmessage/llhost.cpp b/indra/llmessage/llhost.cpp index 501d9465c2..66203321ef 100644 --- a/indra/llmessage/llhost.cpp +++ b/indra/llmessage/llhost.cpp @@ -68,7 +68,7 @@ void LLHost::getIPString(char* buffer, S32 length) const std::string LLHost::getIPandPort() const { - char buffer[MAXADDRSTR + 1 + 5]; + char buffer[MAXADDRSTR + 1 + 5]; /*Flawfinder: ignore*/ getString(buffer, sizeof(buffer)); return buffer; } diff --git a/indra/llmessage/llhttpassetstorage.cpp b/indra/llmessage/llhttpassetstorage.cpp index 23beeafb13..d429dd5b63 100644 --- a/indra/llmessage/llhttpassetstorage.cpp +++ b/indra/llmessage/llhttpassetstorage.cpp @@ -99,7 +99,7 @@ LLHTTPAssetRequest::LLHTTPAssetRequest(LLHTTPAssetStorage *asp, const LLUUID &uu mURLBuffer = new char[strlen(url) + 1]; /*Flawfinder: ignore*/ if (mURLBuffer) { - strcpy(mURLBuffer, url); + strcpy(mURLBuffer, url); /*Flawfinder: ignore*/ } } diff --git a/indra/llmessage/llinstantmessage.cpp b/indra/llmessage/llinstantmessage.cpp index 10ff8eb88d..ecdc9e6dc3 100644 --- a/indra/llmessage/llinstantmessage.cpp +++ b/indra/llmessage/llinstantmessage.cpp @@ -207,8 +207,8 @@ void pack_instant_message_block( S32 bytes_left = MTUBYTES; if(message) { - char buffer[MTUBYTES]; - bytes_left -= snprintf(buffer, MTUBYTES, "%s", message); + char buffer[MTUBYTES]; /*Flawfinder: ignore*/ + bytes_left -= snprintf(buffer, MTUBYTES, "%s", message); /*Flawfinder: ignore*/ bytes_left = llmax(0, bytes_left); msg->addStringFast(_PREHASH_Message, buffer); } @@ -244,11 +244,11 @@ void LLIMInfo::unpackMessageBlock(LLMessageSystem* msg) mIMType = (EInstantMessage) dialog; msg->getUUIDFast(_PREHASH_MessageBlock, _PREHASH_ID, mID); msg->getU32Fast(_PREHASH_MessageBlock, _PREHASH_Timestamp, mTimeStamp); - char name[DB_FULL_NAME_BUF_SIZE]; + char name[DB_FULL_NAME_BUF_SIZE]; /*Flawfinder: ignore*/ msg->getStringFast(_PREHASH_MessageBlock, _PREHASH_FromAgentName, DB_FULL_NAME_BUF_SIZE, name); mName.assign(name); - char message[DB_IM_MSG_BUF_SIZE]; + char message[DB_IM_MSG_BUF_SIZE]; /*Flawfinder: ignore*/ msg->getStringFast(_PREHASH_MessageBlock, _PREHASH_Message, DB_IM_MSG_BUF_SIZE, message); mMessage.assign(message); diff --git a/indra/llmessage/llnamevalue.cpp b/indra/llmessage/llnamevalue.cpp index 02ddec1bf5..46e28ed29e 100644 --- a/indra/llmessage/llnamevalue.cpp +++ b/indra/llmessage/llnamevalue.cpp @@ -40,7 +40,7 @@ user_callback_map_t gUserCallbackMap; LLStringTable gNVNameTable(16384); -char NameValueTypeStrings[NVT_EOF][NAME_VALUE_TYPE_STRING_LENGTH] = +char NameValueTypeStrings[NVT_EOF][NAME_VALUE_TYPE_STRING_LENGTH] = /*Flawfinder: Ignore*/ { "NULL", "STRING", @@ -51,17 +51,17 @@ char NameValueTypeStrings[NVT_EOF][NAME_VALUE_TYPE_STRING_LENGTH] = "CAMERA", // Deprecated, but leaving in case removing completely would cause problems "ASSET", "U64" -}; /*Flawfinder: Ignore*/ +}; -char NameValueClassStrings[NVC_EOF][NAME_VALUE_CLASS_STRING_LENGTH] = +char NameValueClassStrings[NVC_EOF][NAME_VALUE_CLASS_STRING_LENGTH] = /*Flawfinder: Ignore*/ { "NULL", "R", // read only "RW", // read write "CB" // callback -}; /*Flawfinder: Ignore*/ +}; -char NameValueSendtoStrings[NVS_EOF][NAME_VALUE_SENDTO_STRING_LENGTH] = +char NameValueSendtoStrings[NVS_EOF][NAME_VALUE_SENDTO_STRING_LENGTH] = /*Flawfinder: Ignore*/ { "NULL", "S", // "Sim", formerly SIM @@ -393,11 +393,11 @@ LLNameValue::LLNameValue(const char *name, const char *type, const char *nvclass LLNameValue::LLNameValue(const char *data) { baseInit(); - static char name[NV_BUFFER_LEN]; - static char type[NV_BUFFER_LEN]; - static char nvclass[NV_BUFFER_LEN]; - static char nvsendto[NV_BUFFER_LEN]; - static char nvdata[NV_BUFFER_LEN]; + static char name[NV_BUFFER_LEN]; /*Flawfinder: ignore*/ + static char type[NV_BUFFER_LEN]; /*Flawfinder: ignore*/ + static char nvclass[NV_BUFFER_LEN]; /*Flawfinder: ignore*/ + static char nvsendto[NV_BUFFER_LEN]; /*Flawfinder: ignore*/ + static char nvdata[NV_BUFFER_LEN]; /*Flawfinder: ignore*/ S32 i; @@ -421,7 +421,7 @@ LLNameValue::LLNameValue(const char *data) } // read in the name - sscanf((data + character_count), "%2047s", name); + sscanf((data + character_count), "%2047s", name); /*Flawfinder: ignore*/ // bump past it and add null terminator length = (S32)strlen(name); /* Flawfinder: ignore */ @@ -445,7 +445,7 @@ LLNameValue::LLNameValue(const char *data) } // read in the type - sscanf((data + character_count), "%2047s", type); + sscanf((data + character_count), "%2047s", type); /*Flawfinder: ignore*/ // bump past it and add null terminator length = (S32)strlen(type); /* Flawfinder: ignore */ @@ -481,7 +481,7 @@ LLNameValue::LLNameValue(const char *data) { // yes we do! // read in the class - sscanf((data + character_count), "%2047s", nvclass); + sscanf((data + character_count), "%2047s", nvclass); /*Flawfinder: ignore*/ // bump past it and add null terminator length = (S32)strlen(nvclass); /* Flawfinder: ignore */ @@ -523,7 +523,7 @@ LLNameValue::LLNameValue(const char *data) if (i != NVS_EOF) { // found a sendto argument - sscanf((data + character_count), "%2047s", nvsendto); + sscanf((data + character_count), "%2047s", nvsendto); /*Flawfinder: ignore*/ // add null terminator length = (S32)strlen(nvsendto); /* Flawfinder: ignore */ diff --git a/indra/llmessage/llpacketack.h b/indra/llmessage/llpacketack.h index 1b62dc9415..0874da6236 100644 --- a/indra/llmessage/llpacketack.h +++ b/indra/llmessage/llpacketack.h @@ -111,7 +111,7 @@ public: mBuffer = new U8[buf_len]; if (mBuffer != NULL) { - memcpy(mBuffer,buf_ptr,buf_len); + memcpy(mBuffer,buf_ptr,buf_len); /*Flawfinder: ignore*/ mBufferLength = buf_len; } diff --git a/indra/llmessage/llpacketbuffer.cpp b/indra/llmessage/llpacketbuffer.cpp index 95c2217a69..d5796c131b 100644 --- a/indra/llmessage/llpacketbuffer.cpp +++ b/indra/llmessage/llpacketbuffer.cpp @@ -25,7 +25,7 @@ LLPacketBuffer::LLPacketBuffer(const LLHost &host, const char *datap, const S32 if (datap != NULL) { - memcpy(mData, datap, size); + memcpy(mData, datap, size); /*Flawfinder: ignore*/ mSize = size; } diff --git a/indra/llmessage/llpacketring.cpp b/indra/llmessage/llpacketring.cpp index 1bf72edfc1..e3612120d1 100644 --- a/indra/llmessage/llpacketring.cpp +++ b/indra/llmessage/llpacketring.cpp @@ -113,7 +113,7 @@ S32 LLPacketRing::receiveFromRing (S32 socket, char *datap) packet_size = packetp->getSize(); if (packetp->getData() != NULL) { - memcpy(datap, packetp->getData(), packet_size); + memcpy(datap, packetp->getData(), packet_size); /*Flawfinder: ignore*/ } // need to set sender IP/port!! mLastSender = packetp->getHost(); diff --git a/indra/llmessage/lltransfermanager.cpp b/indra/llmessage/lltransfermanager.cpp index 34344040b8..51c3aafbbb 100644 --- a/indra/llmessage/lltransfermanager.cpp +++ b/indra/llmessage/lltransfermanager.cpp @@ -346,7 +346,7 @@ void LLTransferManager::processTransferInfo(LLMessageSystem *msgp, void **) { if ((packetp->mDatap != NULL) && (size<(S32)sizeof(tmp_data))) { - memcpy(tmp_data, packetp->mDatap, size); + memcpy(tmp_data, packetp->mDatap, size); /*Flawfinder: ignore*/ } } status = packetp->mStatus; @@ -519,7 +519,7 @@ void LLTransferManager::processTransferPacket(LLMessageSystem *msgp, void **) { if ((packetp->mDatap != NULL) && (size<(S32)sizeof(tmp_data))) { - memcpy(tmp_data, packetp->mDatap, size); + memcpy(tmp_data, packetp->mDatap, size); /*Flawfinder: ignore*/ } } status = packetp->mStatus; @@ -1157,7 +1157,7 @@ LLTransferPacket::LLTransferPacket(const S32 packet_id, const LLTSCode status, c mDatap = new U8[size]; if (mDatap != NULL) { - memcpy(mDatap, datap, size); + memcpy(mDatap, datap, size); /*Flawfinder: ignore*/ } } diff --git a/indra/llmessage/llxfer.cpp b/indra/llmessage/llxfer.cpp index f43a8a56ff..1a1492c20a 100644 --- a/indra/llmessage/llxfer.cpp +++ b/indra/llmessage/llxfer.cpp @@ -116,7 +116,7 @@ S32 LLXfer::receiveData (char *datap, S32 data_size) { if (datap != NULL) { - memcpy(&mBuffer[mBufferLength],datap,data_size); + memcpy(&mBuffer[mBufferLength],datap,data_size); /*Flawfinder: ignore*/ mBufferLength += data_size; } else @@ -193,7 +193,7 @@ void LLXfer::sendPacket(S32 packet_num) num_copy = llmin(num_copy, (S32)(mBufferLength - desired_read_position)); if (num_copy > 0) { - memcpy(fdata_buf,&mBuffer[desired_read_position],num_copy); + memcpy(fdata_buf,&mBuffer[desired_read_position],num_copy); /*Flawfinder: ignore*/ } } else @@ -206,7 +206,7 @@ void LLXfer::sendPacket(S32 packet_num) (S32)(mBufferLength - desired_read_position)); if (num_copy > 0) { - memcpy( + memcpy( /*Flawfinder: ignore*/ fdata_buf + sizeof(S32), &mBuffer[desired_read_position], num_copy); diff --git a/indra/llmessage/llxfer_file.cpp b/indra/llmessage/llxfer_file.cpp index da72467c76..46d31685e3 100644 --- a/indra/llmessage/llxfer_file.cpp +++ b/indra/llmessage/llxfer_file.cpp @@ -394,8 +394,8 @@ U32 LLXfer_File::getXferTypeTag() S32 copy_file(const char* from, const char* to) { S32 rv = 0; - FILE* in = LLFile::fopen(from, "rb"); - FILE* out = LLFile::fopen(to, "wb"); + FILE* in = LLFile::fopen(from, "rb"); /*Flawfinder: ignore*/ + FILE* out = LLFile::fopen(to, "wb"); /*Flawfinder: ignore*/ if(in && out) { S32 read = 0; diff --git a/indra/llmessage/message.cpp b/indra/llmessage/message.cpp index f849e989b4..dc05e9c8ed 100644 --- a/indra/llmessage/message.cpp +++ b/indra/llmessage/message.cpp @@ -968,7 +968,7 @@ void LLMessageSystem::loadTemplateFile(const char* filename) LLMessageVariable var; char var_name[MAX_MESSAGE_INTERNAL_NAME_SIZE]; /* Flawfinder: ignore */ - char formatString[MAX_MESSAGE_INTERNAL_NAME_SIZE]; + char formatString[MAX_MESSAGE_INTERNAL_NAME_SIZE]; /* Flawfinder: ignore */ FILE* messagefilep = NULL; mMessageFileChecksum = 0; @@ -976,14 +976,19 @@ void LLMessageSystem::loadTemplateFile(const char* filename) S32 checksum_offset = 0; char* checkp = NULL; - snprintf(formatString, sizeof(formatString), "%%%ds", MAX_MESSAGE_INTERNAL_NAME_SIZE); - messagefilep = LLFile::fopen(filename, "r"); + // scanf needs 1 byte more than width, thus the MAX_... -1. + snprintf( /* Flawfinder: ignore */ + formatString, + sizeof(formatString), + "%%%ds", + MAX_MESSAGE_INTERNAL_NAME_SIZE - 1); + messagefilep = LLFile::fopen(filename, "r"); /* Flawfinder: ignore */ if (messagefilep) { // mName = gMessageStringTable.getString(filename); fseek(messagefilep, 0L, SEEK_SET ); - while(fscanf(messagefilep, formatString, token) != EOF) + while(fscanf(messagefilep, formatString, token) != EOF) /* Flawfinder: ignore */ { // skip comments if (token[0] == '/') @@ -1113,7 +1118,7 @@ void LLMessageSystem::loadTemplateFile(const char* filename) b_template = FALSE; // name first - if (fscanf(messagefilep, formatString, template_name) == EOF) + if (fscanf(messagefilep, formatString, template_name) == EOF) /* Flawfinder: ignore */ { // oops, file ended llerrs << "Expected message template name, but file ended" @@ -1145,7 +1150,7 @@ void LLMessageSystem::loadTemplateFile(const char* filename) } // ok, now get Frequency ("High", "Medium", or "Low") - if (fscanf(messagefilep, formatString, token) == EOF) + if (fscanf(messagefilep, formatString, token) == EOF) /* Flawfinder: ignore */ { // oops, file ended llerrs << "Expected message template frequency, found EOF." @@ -1226,7 +1231,7 @@ void LLMessageSystem::loadTemplateFile(const char* filename) else if (!strcmp(token, "Fixed")) { U32 message_num = 0; - if (fscanf(messagefilep, formatString, token) == EOF) + if (fscanf(messagefilep, formatString, token) == EOF) /* Flawfinder: ignore */ { // oops, file ended llerrs << "Expected message template number (fixed)," @@ -1260,7 +1265,7 @@ void LLMessageSystem::loadTemplateFile(const char* filename) } // Now get trust ("Trusted", "NotTrusted") - if (fscanf(messagefilep, formatString, token) == EOF) + if (fscanf(messagefilep, formatString, token) == EOF) /* Flawfinder: ignore */ { // File ended llerrs << "Expected message template " @@ -1297,7 +1302,7 @@ void LLMessageSystem::loadTemplateFile(const char* filename) } // get encoding - if (fscanf(messagefilep, formatString, token) == EOF) + if (fscanf(messagefilep, formatString, token) == EOF) /* Flawfinder: ignore */ { // File ended llerrs << "Expected message encoding, but file ended." @@ -1343,7 +1348,7 @@ void LLMessageSystem::loadTemplateFile(const char* filename) // ok, need to pull header info // name first - if (fscanf(messagefilep, formatString, block_name) == EOF) + if (fscanf(messagefilep, formatString, block_name) == EOF) /* Flawfinder: ignore */ { // oops, file ended llerrs << "Expected block name, but file ended" << llendl; @@ -1371,7 +1376,7 @@ void LLMessageSystem::loadTemplateFile(const char* filename) } // now, block type ("Single", "Multiple", or "Variable") - if (fscanf(messagefilep, formatString, token) == EOF) + if (fscanf(messagefilep, formatString, token) == EOF) /* Flawfinder: ignore */ { // oops, file ended llerrs << "Expected block type, but file ended." << llendl; @@ -1396,7 +1401,7 @@ void LLMessageSystem::loadTemplateFile(const char* filename) else if (!strcmp(token, "Multiple")) { // need to get the number of repeats - if (fscanf(messagefilep, formatString, token) == EOF) + if (fscanf(messagefilep, formatString, token) == EOF) /* Flawfinder: ignore */ { // oops, file ended llerrs << "Expected block multiple count," @@ -1452,7 +1457,7 @@ void LLMessageSystem::loadTemplateFile(const char* filename) // ok, need to pull header info // name first - if (fscanf(messagefilep, formatString, var_name) == EOF) + if (fscanf(messagefilep, formatString, var_name) == EOF) /* Flawfinder: ignore */ { // oops, file ended llerrs << "Expected variable name, but file ended." @@ -1481,7 +1486,7 @@ void LLMessageSystem::loadTemplateFile(const char* filename) } // now, variable type ("Fixed" or "Variable") - if (fscanf(messagefilep, formatString, token) == EOF) + if (fscanf(messagefilep, formatString, token) == EOF) /* Flawfinder: ignore */ { // oops, file ended llerrs << "Expected variable type, but file ended" @@ -1575,7 +1580,7 @@ void LLMessageSystem::loadTemplateFile(const char* filename) else if (!strcmp(token, "Fixed")) { // need to get the variable size - if (fscanf(messagefilep, formatString, token) == EOF) + if (fscanf(messagefilep, formatString, token) == EOF) /* Flawfinder: ignore */ { // oops, file ended llerrs << "Expected variable size, but file ended" @@ -1608,7 +1613,7 @@ void LLMessageSystem::loadTemplateFile(const char* filename) else if (!strcmp(token, "Variable")) { // need to get the variable size - if (fscanf(messagefilep, formatString, token) == EOF) + if (fscanf(messagefilep, formatString, token) == EOF) /* Flawfinder: ignore */ { // oops, file ended llerrs << "Expected variable size, but file ended" @@ -1657,7 +1662,7 @@ void LLMessageSystem::loadTemplateFile(const char* filename) if (!strcmp(token, "version")) { // version number - if (fscanf(messagefilep, formatString, token) == EOF) + if (fscanf(messagefilep, formatString, token) == EOF) /* Flawfinder: ignore */ { // oops, file ended llerrs << "Expected version number, but file ended" @@ -2715,7 +2720,7 @@ void LLMessageSystem::buildMessage() temp_block_number = (U8)mbci->mBlockNumber; if ((S32)(mSendSize + sizeof(U8)) < MAX_BUFFER_SIZE) { - memcpy(&mSendBuffer[mSendSize], &temp_block_number, sizeof(U8)); + memcpy(&mSendBuffer[mSendSize], &temp_block_number, sizeof(U8)); /* Flawfinder: ignore */ mSendSize += sizeof(U8); } else @@ -2792,7 +2797,7 @@ void LLMessageSystem::buildMessage() { if(mSendSize + mvci.getSize() < (S32)sizeof(mSendBuffer)) { - memcpy( + memcpy( /* Flawfinder: ignore */ &mSendBuffer[mSendSize], mvci.getData(), mvci.getSize()); @@ -3058,7 +3063,7 @@ S32 LLMessageSystem::sendMessage(const LLHost &host) if((S32)(buffer_length + sizeof(TPACKETID)) < MAX_BUFFER_SIZE) { - memcpy(&buf_ptr[buffer_length], &packet_id, sizeof(TPACKETID)); + memcpy(&buf_ptr[buffer_length], &packet_id, sizeof(TPACKETID)); /* Flawfinder: ignore */ // Do the accounting buffer_length += sizeof(TPACKETID); } @@ -3166,7 +3171,7 @@ BOOL LLMessageSystem::decodeTemplate( // it appears that if there is a NULL in the message #, it won't copy it.... // what was the goal? //if(header[2]) - memcpy(&message_id_U16, &header[2], 2); + memcpy(&message_id_U16, &header[2], 2); /* Flawfinder: ignore */ // dependant on endian-ness: // U32 temp = (255 << 24) | (255 << 16) | header[2]; @@ -3577,7 +3582,7 @@ void LLMessageSystem::getDataFast(const char *blockname, const char *varname, vo ((U32*)datap)[1] = ((U32*)vardata.getData())[1]; break; default: - memcpy(datap, vardata.getData(), vardata_size); + memcpy(datap, vardata.getData(), vardata_size); /* Flawfinder: ignore */ break; } } @@ -3589,7 +3594,7 @@ void LLMessageSystem::getDataFast(const char *blockname, const char *varname, vo << " but truncated to max size of " << max_size << llendl; - memcpy(datap, vardata.getData(), max_size); + memcpy(datap, vardata.getData(), max_size); /* Flawfinder: ignore */ } } @@ -4456,7 +4461,7 @@ void process_create_trusted_circuit(LLMessageSystem *msg, void **) return; } - char their_digest[MD5HEX_STR_SIZE]; + char their_digest[MD5HEX_STR_SIZE]; /* Flawfinder: ignore */ S32 size = msg->getSizeFast(_PREHASH_DataBlock, _PREHASH_Digest); if(size != MD5HEX_STR_BYTES) { @@ -4536,7 +4541,7 @@ void encrypt_template(const char *src_name, const char *dest_name) BOOL decrypt_template(const char *src_name, const char *dest_name) { S32 buf_length = LL_ENCRYPT_BUF_LENGTH; - char buf[LL_ENCRYPT_BUF_LENGTH]; + char buf[LL_ENCRYPT_BUF_LENGTH]; /* Flawfinder: ignore */ FILE* infp = NULL; FILE* outfp = NULL; @@ -4551,7 +4556,7 @@ BOOL decrypt_template(const char *src_name, const char *dest_name) goto exit; } - infp = LLFile::fopen(src_name,"rb"); + infp = LLFile::fopen(src_name,"rb"); /* Flawfinder: ignore */ if (!infp) { llwarns << "could not open " << src_name << " for reading" << llendl; @@ -4564,7 +4569,7 @@ BOOL decrypt_template(const char *src_name, const char *dest_name) goto exit; } - outfp = LLFile::fopen(dest_name,"w+b"); + outfp = LLFile::fopen(dest_name,"w+b"); /* Flawfinder: ignore */ if (!outfp) { llwarns << "could not open " << src_name << " for writing" << llendl; @@ -4599,7 +4604,7 @@ BOOL decrypt_template(const char *src_name, const char *dest_name) void dump_prehash_files() { U32 i; - FILE *fp = LLFile::fopen("../../indra/llmessage/message_prehash.h", "w"); + FILE* fp = LLFile::fopen("../../indra/llmessage/message_prehash.h", "w"); /* Flawfinder: ignore */ if (fp) { fprintf( @@ -4631,7 +4636,7 @@ void dump_prehash_files() fprintf(fp, "\n\n#endif\n"); fclose(fp); } - fp = LLFile::fopen("../../indra/llmessage/message_prehash.cpp", "w"); + fp = LLFile::fopen("../../indra/llmessage/message_prehash.cpp", "w"); /* Flawfinder: ignore */ if (fp) { fprintf( @@ -5562,7 +5567,7 @@ bool LLMessageSystem::generateDigestForNumberAndUUIDs(char* digest, const U32 nu if( secret != NULL) { - d.update(secret, (U32)strlen((char *) secret)); + d.update(secret, (U32)strlen((char *) secret)); /* Flawfinder: ignore */ } d.update((const unsigned char *) colon, (U32)strlen(colon)); /* Flawfinder: ignore */ @@ -5573,13 +5578,13 @@ bool LLMessageSystem::generateDigestForNumberAndUUIDs(char* digest, const U32 nu d.update((const unsigned char *) colon, (U32)strlen(colon)); /* Flawfinder: ignore */ if( (char*) id1str != NULL) { - d.update(id1str, (U32)strlen((char *) id1str)); + d.update(id1str, (U32)strlen((char *) id1str)); /* Flawfinder: ignore */ } d.update((const unsigned char *) colon, (U32)strlen(colon)); /* Flawfinder: ignore */ if( (char*) id2str != NULL) { - d.update(id2str, (U32)strlen((char *) id2str)); + d.update(id2str, (U32)strlen((char *) id2str)); /* Flawfinder: ignore */ } d.finalize(); diff --git a/indra/llmessage/message_string_table.cpp b/indra/llmessage/message_string_table.cpp index 687b47a112..f36160d4ec 100644 --- a/indra/llmessage/message_string_table.cpp +++ b/indra/llmessage/message_string_table.cpp @@ -57,7 +57,7 @@ char* LLMessageStringTable::getString(const char *str) } } // not found, so add! - strncpy(mString[hash_value], str, MESSAGE_MAX_STRINGS_LENGTH); + strncpy(mString[hash_value], str, MESSAGE_MAX_STRINGS_LENGTH); /* Flawfinder: ignore */ mString[hash_value][MESSAGE_MAX_STRINGS_LENGTH - 1] = 0; mEmpty[hash_value] = FALSE; mUsed++; diff --git a/indra/llmessage/net.cpp b/indra/llmessage/net.cpp index bf8927c7b9..a78b216ccb 100644 --- a/indra/llmessage/net.cpp +++ b/indra/llmessage/net.cpp @@ -124,7 +124,7 @@ char *u32_to_ip_string(U32 ip, char *ip_string) if (result != NULL) { //the function signature needs to change to pass in the lengfth of first and last. - strcpy(ip_string, result); + strcpy(ip_string, result); /*Flawfinder: ignore*/ return ip_string; } else diff --git a/indra/llmessage/partsyspacket.cpp b/indra/llmessage/partsyspacket.cpp index 4030cd815b..6666e064ae 100644 --- a/indra/llmessage/partsyspacket.cpp +++ b/indra/llmessage/partsyspacket.cpp @@ -1246,7 +1246,7 @@ BOOL LLPartSysCompressedPacket::fromUnsignedBytes(U8 *in, U32 bytesUsed) { if ((in != NULL) && (bytesUsed <= sizeof(mData))) { - memcpy(mData, in, bytesUsed); + memcpy(mData, in, bytesUsed); /* Flawfinder: ignore */ mNumBytes = bytesUsed; return TRUE; } |