Fix listen_sockets overflow in close_network_connections()
[tinc] / src / fsck.c
index 8d818a3..b44b775 100644 (file)
@@ -64,6 +64,7 @@ again:
        goto again;
 }
 
+static void print_tinc_cmd(const char *format, ...) ATTR_FORMAT(printf, 1, 2);
 static void print_tinc_cmd(const char *format, ...) {
        if(confbasegiven) {
                fprintf(stderr, "%s -c %s ", exe_name, confbase);
@@ -141,6 +142,11 @@ static void check_conffile(const char *nodename, bool server) {
                ++total_vars;
        }
 
+       if(!total_vars) {
+               splay_empty_tree(&config);
+               return;
+       }
+
        const size_t countlen = total_vars * sizeof(int);
        int *count = alloca(countlen);
        memset(count, 0, countlen);