From a90b8cb58a58f2c77b8c76d76fa88cd241b776cd Mon Sep 17 00:00:00 2001 From: Rafael Zalamena Date: Thu, 14 Dec 2017 13:57:03 -0200 Subject: [PATCH] bgpd: use buffer size instead of hardcoded value 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 --- bgpd/rfapi/rfapi_vty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bgpd/rfapi/rfapi_vty.c b/bgpd/rfapi/rfapi_vty.c index fb7d8beab3..37ca5edc96 100644 --- a/bgpd/rfapi/rfapi_vty.c +++ b/bgpd/rfapi/rfapi_vty.c @@ -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); } -- 2.39.5