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

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 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 Compare June 19, 2020 00:47
@LordAro LordAro merged commit 1ac0d4a into OpenTTD:master Jun 21, 2020
@LordAro LordAro added the backport requested This PR should be backport to current release (RC / stable) label Jul 27, 2020
@glx22 glx22 added backported This PR is backported to a current release (RC / stable) and removed backport requested This PR should be backport to current release (RC / stable) labels Nov 8, 2020
@JGRennison JGRennison deleted the fix-get-address-as-string-thread-safety branch January 9, 2024 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported This PR is backported to a current release (RC / stable)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants