]> 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>
Wed, 15 Jan 2020 17:50:00 +0000 (12:50 -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 4950b8654d55724dc638348b051430630e51d4c4..933a26f94a7ad70371b92c9333ef7a3a49d4be54 100644 (file)
@@ -2068,6 +2068,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);