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

Fix: Thread unsafe use of NetworkAddress::GetAddressAsString #8228

Merged

Conversation

@JGRennison
Copy link
Contributor

@JGRennison JGRennison commented Jun 18, 2020

The static buffer form of NetworkAddress::GetAddressAsString is used from multiple threads and
is not thread safe. Replace it with a mechanism which is thread safe.

@LordAro
Copy link
Member

@LordAro LordAro commented Jun 18, 2020

Feels a bit like a hack that std::string would better solve

Remove static buffer form of NetworkAddress::GetAddressAsString.
This is used in multiple threads concurrently, and is not thread-safe.

Replace it with a form returning std::string.
@JGRennison JGRennison force-pushed the fix-get-address-as-string-thread-safety branch from 25d1441 to fea977b Jun 19, 2020
@LordAro LordAro merged commit 1ac0d4a into OpenTTD:master Jun 21, 2020
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants