]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: use buffer size instead of hardcoded value
authorRafael Zalamena <rzalamena@opensourcerouting.org>
Thu, 14 Dec 2017 15:57:03 +0000 (13:57 -0200)
committerRafael Zalamena <rzalamena@opensourcerouting.org>
Thu, 14 Dec 2017 16:03:14 +0000 (14:03 -0200)
This is a possible buffer overflow.

We should always use the buffer size (whenever possible) to tell
functions what the size of the buffer is, instead of a hardcoded value.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
bgpd/rfapi/rfapi_vty.c

index fb7d8beab32e242fa0e02d6fce20efffe8797d31..37ca5edc96dfde0b2532c584a98e0f18f1586983 100644 (file)
@@ -1529,7 +1529,7 @@ void rfapiPrintRd(struct vty *vty, struct prefix_rd *prd)
 {
        char buf[RD_ADDRSTRLEN];
 
-       prefix_rd2str(prd, buf, BUFSIZ);
+       prefix_rd2str(prd, buf, sizeof(buf));
        vty_out(vty, "%s", buf);
 }