From f44ad7e6084436cfd8fdc8d817c92f25d305f68d Mon Sep 17 00:00:00 2001 From: Bram Matthys Date: Mon, 31 Aug 2015 09:30:59 +0200 Subject: [PATCH] Fix possible crash on boot with bind/listen errors. --- src/s_bsd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/s_bsd.c b/src/s_bsd.c index d00497dbc..279c0676f 100644 --- a/src/s_bsd.c +++ b/src/s_bsd.c @@ -340,8 +340,8 @@ int inetport(ConfigItem_listen *listener, char *ip, int port, int ipv6) } /* At first, open a new socket */ - if (listener->fd != -1) - abort(); /* there was a (reverse check) for this. let's see if this ever happened :) */ + if (listener->fd >= 0) + abort(); /* Socket already exists but we are asked to create and listen on one. Bad! */ if (port == 0) abort(); /* Impossible as well, right? */