Cygwin: posix timers: allocate timer_tracker on system heap.

Allocating on the cygheap would copy information of the tracker into
the child process.  A forked child knows the timer id and could simply
still access the (free'd but still valid) timer_tracker on the heap,
which is dangerous and very certainly doesn't reflect POSIX semantics.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen
2019-01-22 16:22:45 +01:00
parent 6c44af8179
commit 83c51fffe6
3 changed files with 5 additions and 5 deletions

View File

@ -30,7 +30,7 @@ class timer_tracker
public:
void *operator new (size_t, void *p) __attribute__ ((nothrow)) {return p;}
void operator delete (void *p) { cfree (p); }
void operator delete (void *p) { HeapFree (GetProcessHeap (), 0, p); }
timer_tracker (clockid_t, const sigevent *);
~timer_tracker ();
inline bool is_timer_tracker () const { return magic == TT_MAGIC; }