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

Add check for hash_update so that hash_update_fn doesn't add or remove a record with the same key #80

Open
prajnoha opened this issue Feb 17, 2021 · 0 comments

Comments

@prajnoha
Copy link
Member

From src/include/base/hash.h:

*                                                                                                                                                                                                                                                                                                                             
 * hash_update function calls hash_update_fn callback with hash_update_fn_arg right before the update
 * and based on callback's return value, it either keeps the old data or updates with new data.
 */
int hash_update(struct hash_table *t,
                const void *key, uint32_t key_len,
                void **data, size_t *data_len,
                hash_update_fn_t hash_update_fn, void *hash_update_fn_arg);

We need to add check that hash_update_fn doesn't add or remove a record with the same key as the hash_update is currently processing as that would corrupt the hash.

See also #46 (comment).

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

No branches or pull requests

1 participant