BUG/MAJOR: listener: Make sure the listener exist before using it.
authorOlivier Houchard <cognet@ci0.org>
Mon, 25 Feb 2019 15:18:16 +0000 (16:18 +0100)
committerOlivier Houchard <cognet@ci0.org>
Mon, 25 Feb 2019 15:30:13 +0000 (16:30 +0100)
commitd16a9dfed80e75d730754b717370515265698cdd
tree7f2b0b402e9f4201e48bd995357c631bc757a847
parentbc9d9844d542e8896289af252b5b37149db4a432
BUG/MAJOR: listener: Make sure the listener exist before using it.

In listener_accept(), make sure we have a listener before attempting to
use it.
An another thread may have closed the FD meanwhile, and set fdtab[fd].owner
to NULL.
As the listener is not free'd, it is ok to attempt to accept() a new
connection even if the listener was closed. At worst the fd has been
reassigned to another connection, and accept() will fail anyway.

Many thanks to Richard Russo for reporting the problem, and suggesting the
fix.

This should be backported to 1.9 and 1.8.
src/listener.c