Mercurial > irccd
comparison cmake/IrccdSystem.cmake @ 568:ed986ae52656
Common: avoid early deletion of handler
When network_stream flushes input/output it destroy the handlers before
continuing the block function.
This leads in potential use-after-free results because client handlers
may capture this as a shared_ptr which is deleted in the `pop_front`
call.
if (squeue_.front().second)
squeue_.front().second(code);
squeue_.pop_front();
// ^ ^ ^ Delete handler and possible capture of this
sflush();
// ^ ^ ^ Possible use-after-free of `this`
author | David Demelier <markand@malikania.fr> |
---|---|
date | Tue, 28 Nov 2017 12:20:58 +0100 |
parents | 65e80d258b34 |
children | 27587ff92a64 |
comparison
equal
deleted
inserted
replaced
567:cf734c969727 | 568:ed986ae52656 |
---|