[1/2] batctl: change PATH_BUFF_LEN to maximal possible value
Commit Message
The output of
snprintf(path_buff, PATH_BUFF_LEN, SYS_ROUTING_ALGO_FMT, iface_dir->d_name)
in sys.c can be between 34 and 289 bytes and should not write into a
destination of size 200.
Signed-off-by: Philipp Psurek <philipp.psurek@gmail.com>
---
functions.c | 2 +-
functions.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
Comments
On Tuesday, June 13, 2017 10:25:59 AM CEST Philipp Psurek wrote:
> The output of
>
> snprintf(path_buff, PATH_BUFF_LEN, SYS_ROUTING_ALGO_FMT, iface_dir->d_name)
>
> in sys.c can be between 34 and 289 bytes and should not write into a
> destination of size 200.
>
> Signed-off-by: Philipp Psurek <philipp.psurek@gmail.com>
I've picked this one, but increased the size to 400 to be a bit more future
proof. :)
Thanks,
Simon
@@ -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;
@@ -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);