From: Guus Sliepen Date: Fri, 15 Apr 2016 14:30:45 +0000 (+0200) Subject: Fix crash at startup when Device is not specified on OS X. X-Git-Tag: release-1.1pre12~22 X-Git-Url: https://git.tinc-vpn.org/git/browse?a=commitdiff_plain;h=a0a8f8f81fc8da068e93088c7c13f689a96fac66;p=tinc Fix crash at startup when Device is not specified on OS X. --- diff --git a/src/bsd/device.c b/src/bsd/device.c index 303e9b68..0d41c96f 100644 --- a/src/bsd/device.c +++ b/src/bsd/device.c @@ -147,7 +147,7 @@ static bool setup_device(void) { } } else { #ifdef HAVE_NET_IF_UTUN_H - if(strncmp(device, "utun", 4) == 0 || strncmp(device, "/dev/utun", 9) == 0) + if(device && (strncmp(device, "utun", 4) == 0 || strncmp(device, "/dev/utun", 9) == 0)) device_type = DEVICE_TYPE_UTUN; else #endif