Forráskód Böngészése

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.
Rich Felker 11 éve
szülő
commit
a731e4103b
1 módosított fájl, 1 hozzáadás és 0 törlés
  1. 1 0
      src/thread/synccall.c

+ 1 - 0
src/thread/synccall.c

@@ -58,6 +58,7 @@ void __synccall(void (*func)(void *), void *ctx)
 	sem_init(&chaindone, 0, 0);
 	sem_init(&chainlock, 0, 1);
 	chainlen = 0;
+	head = 0;
 	callback = func;
 	context = ctx;