[commits] [batctl] master: batctl: change PATH_BUFF_LEN to maximal possible value (620226b)

postmaster at open-mesh.org postmaster at open-mesh.org
Tue Jun 13 10:49:53 CEST 2017


Repository : ssh://git@open-mesh.org/batctl

On branch  : master

>---------------------------------------------------------------

commit 620226bf8cff30e6dd966c8fe922b2d4cddf843b
Author: Philipp Psurek <philipp.psurek at gmail.com>
Date:   Tue Jun 13 10:25:59 2017 +0200

    batctl: change PATH_BUFF_LEN to maximal possible value
    
    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 at gmail.com>
    [sw: use higher limits to be future-proof]
    Signed-off-by: Simon Wunderlich <sw at simonwunderlich.de>


>---------------------------------------------------------------

620226bf8cff30e6dd966c8fe922b2d4cddf843b
 functions.c | 2 +-
 functions.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/functions.c b/functions.c
index 2239440..868e0ae 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 400
 
 static struct timespec start_time;
 static char *host_name;
diff --git a/functions.h b/functions.h
index eca1406..16b3a0e 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 400
 
 /* return time delta from start to end in milliseconds */
 void start_timer(void);



More information about the commits mailing list