From d063d1fdc9c20dec8c4a4b6c07bc143edbde35fc Mon Sep 17 00:00:00 2001
From: Dimitri Staessens <dimitri@ouroboros.rocks>
Date: Sat, 19 Jun 2021 15:26:23 +0200
Subject: ipcpd: Fix buffer overflow in flow allocator RIB.

Max value of UINT64 can be 20 characters when printed, need an extra
byte for sprintf trailing '\0'.

Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
---
 src/ipcpd/unicast/fa.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/ipcpd/unicast/fa.c b/src/ipcpd/unicast/fa.c
index bdbb9409..b3b9b42c 100644
--- a/src/ipcpd/unicast/fa.c
+++ b/src/ipcpd/unicast/fa.c
@@ -124,9 +124,9 @@ static int fa_stat_read(const char * path,
 #ifdef IPCP_FLOW_STATS
         struct fa_flow * flow;
         int              fd;
-        char             r_addrstr[20];
-        char             s_eidstr[20];
-        char             r_eidstr[20];
+        char             r_addrstr[21];
+        char             s_eidstr[21];
+        char             r_eidstr[21];
         char             tmstr[20];
         char             castr[1024];
         struct tm *      tm;
-- 
cgit v1.2.3