From 9e0b6d2fa9e1b33a57cbcb91855b7951c74060d5 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Fri, 4 Nov 2016 16:22:49 +0100 Subject: [PATCH] Avoid NULL pointer dereference on macOS --- src/tun.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tun.c b/src/tun.c index b8ed005..47d36fa 100644 --- a/src/tun.c +++ b/src/tun.c @@ -413,7 +413,7 @@ open_tun(const char *tun_device) char tun_name[50]; #ifdef DARWIN - if (!strncmp(tun_device, "utun", 4)) { + if (tun_device != NULL && !strncmp(tun_device, "utun", 4)) { tun_fd = open_utun(tun_device); if (tun_fd >= 0) { return tun_fd;