Skip to content

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

Description

@prajnoha

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).

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions