From 7f5c063ffb1b33830a41b91669155bab051c54bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Gallou=C3=ABt?= Date: Sun, 21 Oct 2018 08:37:53 +0000 Subject: [PATCH] Allow bad use of mud_get_fd() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adrien Gallouët --- mud.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mud.c b/mud.c index cdd33b4..f0d8ef9 100644 --- a/mud.c +++ b/mud.c @@ -985,6 +985,9 @@ mud_create(struct sockaddr *addr) int mud_get_fd(struct mud *mud) { + if (!mud) + return -1; + return mud->fd; }