mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 18:51:29 +00:00
[Tasks] Crash fix with data input sanitization (#2629)
This commit is contained in:
parent
1d06a4117a
commit
3dfeda9cea
@ -192,7 +192,7 @@ std::string Strings::Escape(const std::string &s)
|
|||||||
bool Strings::IsNumber(const std::string &s)
|
bool Strings::IsNumber(const std::string &s)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
auto r = stod(s);
|
auto r = stoi(s);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
catch (std::exception &) {
|
catch (std::exception &) {
|
||||||
|
|||||||
@ -232,8 +232,10 @@ bool TaskManager::LoadTasks(int single_task)
|
|||||||
);
|
);
|
||||||
|
|
||||||
for (auto &&e : zones) {
|
for (auto &&e : zones) {
|
||||||
|
if (Strings::IsNumber(e)) {
|
||||||
ad->zone_ids.push_back(std::stoi(e));
|
ad->zone_ids.push_back(std::stoi(e));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ad->optional = a.optional;
|
ad->optional = a.optional;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user