Fixed some crashes (1.4.12b4)

This commit is contained in:
WolverinDEV 2020-04-15 15:02:59 +02:00
parent 0f1665c97d
commit bb935dd214
6 changed files with 16 additions and 5 deletions

View File

@ -78,11 +78,16 @@ void manager::loadProviders(const std::string& path) {
}
deque<fs::path> paths;
for(const auto& entry : fs::directory_iterator(dir)){
error_code error_code{};
for(const auto& entry : fs::directory_iterator(dir, error_code)){
if(!entry.path().has_extension()) continue;
if(entry.path().extension().string() == ".so")
paths.push_back(entry.path());
}
if(error_code) {
log::log(log::err, "Failed to scan the target directory (" + dir.string() + "): " + error_code.message());
return;
}
std::sort(paths.begin(), paths.end(), [](const fs::path& a, const fs::path& b){ return a.filename().string() < b.filename().string(); });
int index = 0;

@ -1 +1 @@
Subproject commit cc874a443ac40fabf0342b410dae5ae46045fa4f
Subproject commit e7befd4fc9c96b966b459ea5ad8530dc8fe9345b

2
music

@ -1 +1 @@
Subproject commit 7ef7ea785aebc26d3f9c6e396270e7b03eccf587
Subproject commit 8e1ce32ae0b03f54efc54e76cd118cf01057159c

View File

@ -1 +0,0 @@
../repro/env/resources/

View File

@ -369,6 +369,13 @@ bool VoiceClientConnection::next_reassembled_command(unique_lock<std::recursive_
std::string error{};
auto decompressed_size = compression::qlz_decompressed_size(payload.data_ptr(), payload.length());
if(decompressed_size == 0) {
logTrace(this->client->getServerId(), "{} Failed to calculate decompressed size for received command. Dropping packet.", CLIENT_STR_LOG_PREFIX_(this->client));
return false;
} else if(decompressed_size > 20 * 1024 * 1024) { /* max 20MB */
logTrace(this->client->getServerId(), "{} Command packet has a too large compressed size. Dropping packet.", CLIENT_STR_LOG_PREFIX_(this->client));
return false;
}
auto buffer = buffer::allocate_buffer(decompressed_size);
if(!compression::qlz_decompress_payload(payload.data_ptr(), buffer.data_ptr(), &decompressed_size)) {
logTrace(this->client->getServerId(), "{} Failed to decompress received command. Dropping packet.", CLIENT_STR_LOG_PREFIX_(this->client));

2
shared

@ -1 +1 @@
Subproject commit ee7f26b7ed883027f0a81ece1c2aacd41053ce1e
Subproject commit 16c2272fe4b479c55e6db6642d039a42b0774325