mirror of
https://github.com/fluencelabs/musl
synced 2025-06-11 14:01:34 +00:00
fix invalid pointer in synccall (multithread setuid, etc.)
the head pointer was not being reset between calls to synccall, so any use of this interface more than once would build the linked list incorrectly, keeping the (now invalid) list nodes from the previous call.
This commit is contained in:
@ -58,6 +58,7 @@ void __synccall(void (*func)(void *), void *ctx)
|
|||||||
sem_init(&chaindone, 0, 0);
|
sem_init(&chaindone, 0, 0);
|
||||||
sem_init(&chainlock, 0, 1);
|
sem_init(&chainlock, 0, 1);
|
||||||
chainlen = 0;
|
chainlen = 0;
|
||||||
|
head = 0;
|
||||||
callback = func;
|
callback = func;
|
||||||
context = ctx;
|
context = ctx;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user