From f223b3d1d4e40509f7826eed09205022e382d074 Mon Sep 17 00:00:00 2001 From: Quentin Young Date: Fri, 3 Jan 2020 22:30:33 -0500 Subject: [PATCH] zebra: null terminate interface name from wire We read an ifname from the wire but don't make sure its null terminated, fix it Signed-off-by: Quentin Young --- zebra/zapi_msg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c index ad2f5e3c21..bb2e55c87a 100644 --- a/zebra/zapi_msg.c +++ b/zebra/zapi_msg.c @@ -2136,6 +2136,7 @@ static void zread_pseudowire(ZAPI_HANDLER_ARGS) /* Get data. */ STREAM_GET(ifname, s, IF_NAMESIZE); + ifname[IF_NAMESIZE - 1] = '\0'; STREAM_GETL(s, ifindex); STREAM_GETL(s, type); STREAM_GETL(s, af); -- 2.39.5