]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: null terminate interface name from wire
authorQuentin Young <qlyoung@cumulusnetworks.com>
Sat, 4 Jan 2020 03:30:33 +0000 (22:30 -0500)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Sat, 4 Jan 2020 03:30:33 +0000 (22:30 -0500)
We read an ifname from the wire but don't make sure its null terminated,
fix it

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
zebra/zapi_msg.c

index ad2f5e3c21af4ea3acc00d6e0b5ddc3d40589048..bb2e55c87a0eb6db14d2df018067a001f726877a 100644 (file)
@@ -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);