Fix potential security flaws caused by uncontrolled format strings

Make sure format strings are string literals to avoid an uncontrolled format string situation.
This commit is contained in:
Kawe Mazidjatari 2023-04-08 20:13:06 +02:00
parent cebca2ca04
commit 94d30b759d
2 changed files with 3 additions and 3 deletions

View File

@ -41,7 +41,7 @@ void _Error(char* fmt, ...)
}/////////////////////////////
Error(eDLL_T::ENGINE, NO_ERROR, "%s", buf);
v_Error(buf);
v_Error("%s", buf);
}
//-----------------------------------------------------------------------------
@ -68,7 +68,7 @@ void _Warning(int level, char* fmt, ...)
Warning(eDLL_T::COMMON, "Warning(%d):%s", level, buf);
}
v_Warning(level, buf);
v_Warning(level, "%s", buf);
}
#ifndef DEDICATED

View File

@ -227,7 +227,7 @@ void CBanSystem::BanListCheck(void)
string svIpAddress = pNetChan->GetAddress();
Warning(eDLL_T::SERVER, "Removing client '%s' from slot '%i' ('%llu' is banned from this server!)\n", svIpAddress.c_str(), c, pClient->GetNucleusID());
pClient->Disconnect(Reputation_t::REP_MARK_BAD, m_vRefuseList[i].first.c_str());
pClient->Disconnect(Reputation_t::REP_MARK_BAD, "%s", m_vRefuseList[i].first.c_str());
}
}
}