-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
In
Line 321 in a799cd9
| kvtree* file_list = axl_kvtrees[id]; |
axl_kvtrees is accessed without protecting from race conditions.
Looking eg at
Line 98 in a799cd9
| 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.
Metadata
Metadata
Assignees
Labels
No labels