Jump to content

Help with GetQuestFlag exploit fix.


Recommended Posts

Hi devs,

I have a problem with an exploit with CHARACTER::GetQuestFlag. When the char calls a getqf, and he disconnects quickly, the player_id is 0 and core crashes.

I already have a fix i found on epvp but it doesn't work. The core is still crashing.

I have this fix (char.cpp):

int CHARACTER::GetQuestFlag(const std::string& flag) const
{
	quest::CQuestManager& q = quest::CQuestManager::instance();
	quest::PC* pPC = q.GetPC(GetPlayerID());
	if(!pPC) {
		sys_err("Nullpointer in CHARACTER::GetQuestFlag %lu", GetPlayerID()); 
		return 0;
	}
	return pPC->GetFlag(flag);
}
	if(!pPC) {
		sys_err("Nullpointer in CHARACTER::GetQuestFlag %lu", GetPlayerID()); 
		return 0;
	}

In syserr it says "Nullpointer[...]" but it seems like the return 0 doesn't exists because the core crashes.

Then i need a fix... I hope one dev can make it.

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.