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

Use valid address in pthread_setspecific to silence warnings #162

Merged
merged 3 commits into from
Sep 5, 2024
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
7 changes: 5 additions & 2 deletions thread_setup_unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@ static void thread_id(GO_CRYPTO_THREADID_PTR tid)
// per-thread error state, so this function is guaranteed to be executed at
// least once on any thread with associated error state. The thread-local
// variable needs to be set to a non-NULL value so that the destructor will
// be called when the thread exits. The actual value does not matter.
(void) pthread_setspecific(destructor_key, (void*)1);
// be called when the thread exits.
// The actual value does not matter, but should be a pointer with a valid size.
// See https://github.com/golang-fips/openssl/pull/162
static char stub;
(void) pthread_setspecific(destructor_key, &stub);
karianna marked this conversation as resolved.
Show resolved Hide resolved
}

static void cleanup_thread_state(void *ignored)
Expand Down
Loading