Additional SQLite lookup sanitizing.

Using CDClientDatabase::ExecuteQueryWithArgs() across all known lookups.
This commit is contained in:
TheMatt2
2022-01-06 21:12:47 -05:00
parent 4796b551ad
commit e5f7d164cb
16 changed files with 75 additions and 129 deletions

View File

@@ -2509,11 +2509,9 @@ void GameMessages::HandleBBBSaveRequest(RakNet::BitStream* inStream, Entity* ent
const auto zoneId = worldId.GetMapID();
const auto cloneId = worldId.GetCloneID();
std::stringstream query;
query << "SELECT id FROM PropertyTemplate WHERE mapID = " << std::to_string(zoneId) << ";";
auto result = CDClientDatabase::ExecuteQuery(query.str());
auto result = CDClientDatabase::ExecuteQueryWithArgs(
"SELECT id FROM PropertyTemplate WHERE mapID = %d;",
(int) zoneId);
if (result.eof() || result.fieldIsNull(0)) {
return;