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 of binary_to_existing_atom #52

Open
martinsumner opened this issue Dec 5, 2024 · 1 comment
Open

Use of binary_to_existing_atom #52

martinsumner opened this issue Dec 5, 2024 · 1 comment

Comments

@martinsumner
Copy link

martinsumner commented Dec 5, 2024

See basho/riak_core#950

This is an issue where binary_to_existing_atom/2 is used, but the expected existing atom may or may not be present depending on the order which modules have loaded.

There are other places where the function is used:

https://github.com/OpenRiak/riak_core/blob/1b01278e762b835c0777d5c7319fe7b22186560d/src/riak_core_console.erl#L1212

https://github.com/OpenRiak/riak_core/blob/1b01278e762b835c0777d5c7319fe7b22186560d/src/riak_core_console.erl#L1225

binary_to_existing_atom(Val, utf8)

ExistingAtom = binary_to_existing_atom(RW, utf8),

riak_client:fetch(binary_to_existing_atom(QueueName, utf8), C)

QueueName = binary_to_existing_atom(QueueNameBin, utf8),

Mod = binary_to_existing_atom(Type, latin1),

{Name, binary_to_existing_atom(BinType, utf8)};

Is the function used safely in all these places?

@martinsumner martinsumner changed the title Use of binary_to_existingatom Use of binary_to_existing_atom Dec 5, 2024
@martinsumner
Copy link
Author

martinsumner commented Dec 5, 2024

binary_to_existing_atom(Val, utf8)

Appears to be an unused export, so is only used to expand the sync_on_write. This is expanding a default bucket property - so should already be an atom?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant