In
|
kvtree* file_list = axl_kvtrees[id]; |
axl_kvtrees is accessed without protecting from race conditions.
Looking eg at
|
pthread_mutex_lock(&id_lock); |
where one has
pthread_mutex_lock(&id_lock);
int id = axl_kvtrees_count;
axl_kvtrees_count++;
axl_kvtrees = realloc(axl_kvtrees, sizeof(struct kvtree*) * axl_kvtrees_count);
axl_kvtrees[id] = new;
pthread_mutex_unlock(&id_lock);
it seems clear that axl_kvtress is accessed in a multi-threaded context. Since realloc can move the block of data when allocating memory ie in new_ptr = realloc(old_ptrs, new_size) there is no guarantee that new_ptr == old-ptr one must not assume that axl_kvtrees[id] is accessible without the lock.
In
AXL/src/axl_pthread.c
Line 321 in a799cd9
axl_kvtreesis accessed without protecting from race conditions.Looking eg at
AXL/src/axl.c
Line 98 in a799cd9
where one has
it seems clear that
axl_kvtressis accessed in a multi-threaded context. Sincerealloccan move the block of data when allocating memory ie innew_ptr = realloc(old_ptrs, new_size)there is no guarantee thatnew_ptr == old-ptrone must not assume thataxl_kvtrees[id]is accessible without the lock.