diff options
author | AndreyL ProductEngine <alihatskiy@productengine.com> | 2019-11-20 21:41:27 +0200 |
---|---|---|
committer | AndreyL ProductEngine <alihatskiy@productengine.com> | 2019-11-20 21:41:27 +0200 |
commit | 8a0338bda074ca0dd9cc1d50c80b34ae0e60e020 (patch) | |
tree | a40fc9a6ae94e6c52196ef526d9d6dddf6128951 /indra | |
parent | 7ffe8d0a515f57b1127521f79cfefd0b5532f911 (diff) |
Backed out changeset: 3ea1714b65b8
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llimprocessing.cpp | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/indra/newview/llimprocessing.cpp b/indra/newview/llimprocessing.cpp index 61655944a8..e3705e82b9 100644 --- a/indra/newview/llimprocessing.cpp +++ b/indra/newview/llimprocessing.cpp @@ -854,18 +854,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; |