Wipe (some) secrets from memory after use
[tinc] / src / bsd / device.c
index fe2d6c5..badd77d 100644 (file)
@@ -1,7 +1,7 @@
 /*
     device.c -- Interaction BSD tun/tap device
     Copyright (C) 2001-2005 Ivo Timmermans,
-                  2001-2021 Guus Sliepen <guus@tinc-vpn.org>
+                  2001-2022 Guus Sliepen <guus@tinc-vpn.org>
                   2009      Grzegorz Dymarek <gregd72002@googlemail.com>
 
     This program is free software; you can redistribute it and/or modify
@@ -28,7 +28,7 @@
 #include "../xalloc.h"
 
 #ifdef ENABLE_TUNEMU
-#include "bsd/tunemu.h"
+#include "tunemu.h"
 #endif
 
 #ifdef HAVE_NET_IF_UTUN_H
@@ -76,7 +76,9 @@ static bool setup_utun(void) {
                return false;
        }
 
-       struct ctl_info info = {};
+       struct ctl_info info;
+
+       memset(&info, 0, sizeof(info));
 
        strlcpy(info.ctl_name, UTUN_CONTROL_NAME, sizeof(info.ctl_name));