mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-06-09 16:24:22 +00:00
fix: security vulnerabilities (#1980)
* fix: security vulnerabilities Tested that all functions related to the touched files work will test sqlite on a CI build * fix failing test * ai feedback * add buffer size checking * use c_str * dont log session key * Try this for a mac definition * be quiet apple
This commit is contained in:
@@ -797,8 +797,14 @@ std::string CharacterComponent::StatisticsToString() const {
|
||||
return result.str();
|
||||
}
|
||||
|
||||
uint64_t CharacterComponent::GetStatisticFromSplit(std::vector<std::string> split, uint32_t index) {
|
||||
return split.size() > index ? std::stoull(split.at(index)) : 0;
|
||||
uint64_t CharacterComponent::GetStatisticFromSplit(const std::vector<std::string>& split, const uint32_t index) {
|
||||
uint64_t toReturn = 0;
|
||||
if (index < split.size()) {
|
||||
const auto parsed = GeneralUtils::TryParse<uint64_t>(split[index]);
|
||||
if (parsed) toReturn = *parsed;
|
||||
}
|
||||
|
||||
return toReturn;
|
||||
}
|
||||
|
||||
ZoneStatistics& CharacterComponent::GetZoneStatisticsForMap(LWOMAPID mapID) {
|
||||
|
||||
Reference in New Issue
Block a user