mirror of
https://github.com/vale981/tdesktop
synced 2025-03-06 02:01:40 -05:00
Fix crash in selecting unsent messages.
Also add some more checks in file downloads and serialization.
This commit is contained in:
parent
6994201d50
commit
ad6ddcb507
3 changed files with 8 additions and 4 deletions
|
@ -1066,9 +1066,11 @@ void HistoryInner::mouseActionFinish(const QPoint &screenPos, Qt::MouseButton bu
|
|||
return;
|
||||
}
|
||||
if (_mouseAction == MouseAction::PrepareSelect && !_pressWasInactive && !_selected.empty() && _selected.cbegin()->second == FullSelection) {
|
||||
SelectedItems::iterator i = _selected.find(_mouseActionItem);
|
||||
if (i == _selected.cend() && !_mouseActionItem->serviceMsg() && _mouseActionItem->id > 0) {
|
||||
if (_selected.size() < MaxSelectedItems) {
|
||||
auto i = _selected.find(_mouseActionItem);
|
||||
if (i == _selected.cend()) {
|
||||
if (!_mouseActionItem->serviceMsg()
|
||||
&& IsServerMsgId(_mouseActionItem->id)
|
||||
&& _selected.size() < MaxSelectedItems) {
|
||||
if (!_selected.empty() && _selected.cbegin()->second != FullSelection) {
|
||||
_selected.clear();
|
||||
}
|
||||
|
|
|
@ -284,7 +284,7 @@ void DcOptions::constructFromSerialized(const QByteArray &serialized) {
|
|||
|
||||
// https://stackoverflow.com/questions/1076714/max-length-for-client-ip-address
|
||||
constexpr auto kMaxIpSize = 45;
|
||||
if (ipSize > kMaxIpSize) {
|
||||
if (ipSize <= 0 || ipSize > kMaxIpSize) {
|
||||
LOG(("MTP Error: Bad data inside DcOptions::constructFromSerialized()"));
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -662,6 +662,8 @@ void mtpFileLoader::getCdnFileHashesDone(const MTPVector<MTPCdnFileHash> &result
|
|||
}
|
||||
|
||||
void mtpFileLoader::placeSentRequest(mtpRequestId requestId, const RequestData &requestData) {
|
||||
Expects(!_finished);
|
||||
|
||||
_downloader->requestedAmountIncrement(requestData.dcId, requestData.dcIndex, partSize());
|
||||
++_queue->queriesCount;
|
||||
_sentRequests.emplace(requestId, requestData);
|
||||
|
|
Loading…
Add table
Reference in a new issue