summaryrefslogtreecommitdiffstats
path: root/zebra/zebra_fpm_netlink.c
diff options
context:
space:
mode:
authorRafael Zalamena <rzalamena@opensourcerouting.org>2023-01-18 19:53:10 +0100
committerRafael Zalamena <rzalamena@opensourcerouting.org>2023-01-18 19:53:10 +0100
commit18b7958e47b77b3a795ff4022c454c425bbae26d (patch)
treed6599db6c22e54972f838f1719e6cd375035a24b /zebra/zebra_fpm_netlink.c
parentMerge pull request #12653 from opensourcerouting/netns-cs (diff)
downloadfrr-18b7958e47b77b3a795ff4022c454c425bbae26d.tar.xz
frr-18b7958e47b77b3a795ff4022c454c425bbae26d.zip
zebra: fix fpm netlink encode out of bounds read
Don't attempt to encode the pointer address instead pass the pointer directly so the real contents can be accessed. (`ri->pref_src` type is `union g_addr *`) Found by Coverity Scan (CID 1482162) Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Diffstat (limited to 'zebra/zebra_fpm_netlink.c')
-rw-r--r--zebra/zebra_fpm_netlink.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/zebra/zebra_fpm_netlink.c b/zebra/zebra_fpm_netlink.c
index 5cefa16cd..628d4a2a8 100644
--- a/zebra/zebra_fpm_netlink.c
+++ b/zebra/zebra_fpm_netlink.c
@@ -511,7 +511,7 @@ static int netlink_route_info_encode(struct netlink_route_info *ri,
done:
if (ri->pref_src) {
- nl_attr_put(&req->n, in_buf_len, RTA_PREFSRC, &ri->pref_src,
+ nl_attr_put(&req->n, in_buf_len, RTA_PREFSRC, ri->pref_src,
bytelen);
}