'snprintf' output in sys.c can be between 34 and 289 bytes and should not write into a destination of size 200
snprintf(path_buff, PATH_BUFF_LEN, SYS_ROUTING_ALGO_FMT, iface_dir->d_name);
diff --git a/functions.c b/functions.c index 2239440..8337ee8 100644 --- a/functions.c +++ b/functions.c @@ -59,7 +59,7 @@ #include "debugfs.h" #include "netlink.h"
-#define PATH_BUFF_LEN 200 +#define PATH_BUFF_LEN 289
static struct timespec start_time; static char *host_name; diff --git a/functions.h b/functions.h index eca1406..c0a02a8 100644 --- a/functions.h +++ b/functions.h @@ -31,7 +31,7 @@ #define ETH_STR_LEN 17 #define BATMAN_ADV_TAG "batman-adv:"
-#define PATH_BUFF_LEN 200 +#define PATH_BUFF_LEN 289
/* return time delta from start to end in milliseconds */ void start_timer(void);