Fix crash at startup when Device is not specified on OS X.

This commit is contained in:
Guus Sliepen 2016-04-15 16:30:45 +02:00
parent 8afb52a39a
commit a0a8f8f81f

View file

@ -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