Skip to content

An improper locking bug(e.g., deadlock) on the lock h->cache_mutex #14

@ycaibb

Description

@ycaibb

Hi, developers, thank you for your checking. It seems the lock h->cache_mutex is not released correctly when newBlocks == NULL in the function chm_set_param?

CHMLib/src/chm_lib.c

Lines 1026 to 1035 in 2bef8d0

CHM_ACQUIRE_LOCK(h->cache_mutex);
if (paramVal != h->cache_num_blocks)
{
UChar **newBlocks;
UInt64 *newIndices;
int i;
/* allocate new cached blocks */
newBlocks = (UChar **)malloc(paramVal * sizeof (UChar *));
if (newBlocks == NULL) return;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions