=================================================================== RCS file: /cvs/cvs/blind/config.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -p -r1.1 -r1.2 --- blind/config.c 2022/03/17 21:15:43 1.1 +++ blind/config.c 2022/03/18 20:54:01 1.2 @@ -15,8 +15,10 @@ */ #include +#include #include "blind.h" +#include "log.h" struct blind * config_init(void); @@ -28,6 +30,12 @@ config_init(void) if ((cfg = calloc(1, sizeof(*cfg))) == NULL) return cfg; + if (strlcpy(cfg->bl_conf, BL_CONF, PATH_MAX) >= PATH_MAX) + log_fatal("config file exceeds PATH_MAX"); + + if (strlcpy(cfg->bl_sock, BL_SOCK, PATH_MAX) >= PATH_MAX) + log_fatal("socket file exceeds PATH_MAX"); + cfg->bl_ttl = BL_TTL; return cfg;