fixed early crash caused by calling rsBanList before it is initialized

This commit is contained in:
csoler 2019-12-02 13:14:56 +00:00
parent 60ed77461a
commit b799f18df8

View File

@ -79,6 +79,12 @@ virtual int dhtInfoCallback(const bdId *id, uint32_t type, uint32_t flags, std::
virtual int dhtIsBannedCallback(const sockaddr_in *addr, bool *isBanned)
{
if(!rsBanList)
{
*isBanned = true; // rsBanList is not enabled yet. For security, default to banned.
return 0;
}
// check whether ip filtering is enabled
// if not return 0 to signal that no filter is available
if(!rsBanList->ipFilteringEnabled())