summaryrefslogtreecommitdiff
path: root/indra/newview/llimprocessing.cpp
diff options
context:
space:
mode:
authorAndreyL ProductEngine <alihatskiy@productengine.com>2019-11-27 22:36:28 +0200
committerAndreyL ProductEngine <alihatskiy@productengine.com>2019-11-27 22:36:28 +0200
commit216fe3d47f14709df5f3477b6ae12def214488d6 (patch)
tree5b8f0a66debc4b9b572486885aa0e5cad3fd6a39 /indra/newview/llimprocessing.cpp
parentfed4d3391cf704fb080cf95e15cd992351ba0575 (diff)
parentd3f389a38c8c5a2e394ad5f4ee44128e0e2b2dd3 (diff)
Merged in pe_devs/494-wassail
Diffstat (limited to 'indra/newview/llimprocessing.cpp')
-rw-r--r--indra/newview/llimprocessing.cpp35
1 files changed, 28 insertions, 7 deletions
diff --git a/indra/newview/llimprocessing.cpp b/indra/newview/llimprocessing.cpp
index 28210fdb00..61c8a3a898 100644
--- a/indra/newview/llimprocessing.cpp
+++ b/indra/newview/llimprocessing.cpp
@@ -855,18 +855,39 @@ void LLIMProcessing::processNewMessage(LLUUID from_id,
}
else // IM_TASK_INVENTORY_OFFERED
{
- info->mType = (LLAssetType::EType) binary_bucket[0];
- info->mObjectID = LLUUID::null;
- info->mFromObject = TRUE;
- }
+ if (offline == IM_OFFLINE && session_id.isNull() && aux_id.notNull() && binary_bucket_size > sizeof(S8)* 5)
+ {
+ // cap received offline message
+ std::string str_bucket = ll_safe_string((char*)binary_bucket, binary_bucket_size);
+ typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
+ boost::char_separator<char> sep("|", "", boost::keep_empty_tokens);
+ tokenizer tokens(str_bucket, sep);
+ tokenizer::iterator iter = tokens.begin();
+
+ info->mType = (LLAssetType::EType)(atoi((*(iter++)).c_str()));
+ // Note There is more elements in 'tokens' ...
- // In the case of an offline message, the transaction id will be in aux_id and th session_id will be null
- // (conversely when online the transaction id is passed as session_id)
- info->mTransactionID = session_id.isNull() ? aux_id : session_id;
+ info->mObjectID = LLUUID::null;
+ info->mFromObject = TRUE;
+ }
+ else
+ {
+ if (sizeof(S8) != binary_bucket_size)
+ {
+ LL_WARNS("Messaging") << "Malformed inventory offer from object" << LL_ENDL;
+ delete info;
+ break;
+ }
+ info->mType = (LLAssetType::EType) binary_bucket[0];
+ info->mObjectID = LLUUID::null;
+ info->mFromObject = TRUE;
+ }
+ }
info->mIM = dialog;
info->mFromID = from_id;
info->mFromGroup = from_group;
+ info->mTransactionID = session_id;
info->mFolderID = gInventory.findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(info->mType));
info->mFromName = name;