otland / forgottenserver

A free and open-source MMORPG server emulator written in C++
https://otland.net
GNU General Public License v2.0
1.59k stars 1.06k forks source link

Possible Crash in Protocolgame.cpp #2829

Closed yamaken93 closed 1 year ago

yamaken93 commented 4 years ago

https://github.com/otland/forgottenserver/blob/master/src/protocolgame.cpp#L268 As far i understand, ProtocolGame::writeToOutputBuffer and Protocol::getOutputBuffer should be only called by dispatcher thread. As far i can tell, that line i pointed earlier is the only place where this rule is violated(its being called by the ASIO thread).

My suggestion is to move it to ProtocolGame::login(which is called by the dispatcher thread).

yamaken93 commented 4 years ago

Maybe it won't crash thanks to OutputMessagePool::getInstance().addProtocolToAutosend(shared_from_this()); being called by dispatcher thread 100% of times after the call to writeToOutputBuffer i thought could crash TFS.

Zbizu commented 3 years ago

The link doesn't seem to match with the file. Was it fixed? If not, any ideas of situations in which it could crash?