diff --git a/bbs.c b/bbs.c index 8f800cf..8005e29 100644 --- a/bbs.c +++ b/bbs.c @@ -52,7 +52,7 @@ void broadcast(char *mess, ...) { - if (conf.broadcast_enable) { + if (conf.broadcast_enable && conf.broadcast_port > 1024 && conf.broadcast_port < 65536 && conf.broadcast_address != NULL) { bcast_sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); ret=setsockopt(bcast_sock, SOL_SOCKET, SO_BROADCAST, &broadcastEnable, sizeof(broadcastEnable)); diff --git a/main.c b/main.c index f12880b..574c058 100644 --- a/main.c +++ b/main.c @@ -853,6 +853,8 @@ int main(int argc, char **argv) { conf.archiver_path = NULL; conf.archiver_count = 0; conf.broadcast_enable = 0; + conf.broadcast_port = 0; + conf.broadcast_address = NULL; // Load BBS data if (ini_parse(argv[1], handler, &conf) <0) {