Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

server search handling uses unguarded global map #100

Closed
mdavidsaver opened this issue May 18, 2018 · 2 comments
Closed

server search handling uses unguarded global map #100

mdavidsaver opened this issue May 18, 2018 · 2 comments
Assignees
Milestone

Comments

@mdavidsaver
Copy link
Member

I'd noticed s_channelNameToProvider before, I hadn't noticed that it is static. So in addition to not being guarded from concurrent access, it allows cross-talk between separate servers operating within the same process (aka a gateway).

// TODO
static std::map<std::string, std::tr1::weak_ptr<ChannelProvider> > s_channelNameToProvider;

@mdavidsaver mdavidsaver self-assigned this May 18, 2018
@mdavidsaver
Copy link
Member Author

I also missed a third problem, that this code was using ServerSearchHandler::s_channelNameToProvider[channelName].lock() w/o considering that operator[] implicitly insert()s when name doesn't exist. In this case a NULL weak_ptr. An that lock() returns NULL instead of throwing. So attempting to createChannel() for a name which never had a successful search would crash was well.

All three aspects should be fixed by 12e7b78

@mdavidsaver mdavidsaver added this to the Release 6.1 milestone May 23, 2018
@mdavidsaver mdavidsaver reopened this May 23, 2018
@mdavidsaver
Copy link
Member Author

Released with Base 7.0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant