Skip to content

Hoist value access outside section without lock #6342

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
Mar 6, 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
14 changes: 11 additions & 3 deletions ocaml/auth/xa_auth_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,23 @@ void __attribute__((constructor)) stub_XA_workaround(void)
}

/* key:string -> setting:string -> string option */
CAMLprim value stub_XA_crypt_r(value key, value setting) {
CAMLparam2(key, setting);
CAMLprim value stub_XA_crypt_r(value key_val, value setting_val) {
CAMLparam2(key_val, setting_val);
CAMLlocal1(result);

struct crypt_data cd = {0};

char* const key =
caml_stat_strdup(String_val(key_val));
char* const setting =
caml_stat_strdup(String_val(setting_val));

caml_release_runtime_system();
const char* const hashed =
crypt_r(String_val(key), String_val(setting), &cd);
crypt_r(key, setting, &cd);

caml_stat_free(key);
caml_stat_free(setting);
caml_acquire_runtime_system();

if (!hashed || *hashed == '*')
Expand Down
Loading