Skip to content

ZOOKEEPER-4810: Fix buf data race at format_endpoint_info #2140

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

Merged
merged 1 commit into from
Jun 23, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions zookeeper-client/zookeeper-client-c/src/zookeeper.c
Original file line number Diff line number Diff line change
Expand Up @@ -5111,11 +5111,11 @@ int zoo_add_auth(zhandle_t *zh,const char* scheme,const char* cert,

static const char* format_endpoint_info(const struct sockaddr_storage* ep)
{
static char buf[134] = { 0 };
static __thread char buf[134] = { 0 };
char addrstr[INET6_ADDRSTRLEN] = { 0 };
const char *fmtstring;
void *inaddr;
char is_inet6 = 0; // poor man's boolean
char is_inet6 = 0; // poor man's boolean
#ifdef _WIN32
char * addrstring;
#endif
Expand Down