mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 15:47:22 +00:00
Merge pull request #11626 from opensourcerouting/fix/avoid_buffer_overflow
zebra: Avoid buffer overflow using netlink_parse_rtattr_nested()
This commit is contained in:
commit
5f5b29862f
@ -437,10 +437,10 @@ static enum seg6local_action_t
|
||||
parse_encap_seg6local(struct rtattr *tb,
|
||||
struct seg6local_context *ctx)
|
||||
{
|
||||
struct rtattr *tb_encap[256] = {};
|
||||
struct rtattr *tb_encap[SEG6_LOCAL_MAX + 1] = {};
|
||||
enum seg6local_action_t act = ZEBRA_SEG6_LOCAL_ACTION_UNSPEC;
|
||||
|
||||
netlink_parse_rtattr_nested(tb_encap, 256, tb);
|
||||
netlink_parse_rtattr_nested(tb_encap, SEG6_LOCAL_MAX, tb);
|
||||
|
||||
if (tb_encap[SEG6_LOCAL_ACTION])
|
||||
act = *(uint32_t *)RTA_DATA(tb_encap[SEG6_LOCAL_ACTION]);
|
||||
@ -465,11 +465,11 @@ parse_encap_seg6local(struct rtattr *tb,
|
||||
|
||||
static int parse_encap_seg6(struct rtattr *tb, struct in6_addr *segs)
|
||||
{
|
||||
struct rtattr *tb_encap[256] = {};
|
||||
struct rtattr *tb_encap[SEG6_IPTUNNEL_MAX + 1] = {};
|
||||
struct seg6_iptunnel_encap *ipt = NULL;
|
||||
struct in6_addr *segments = NULL;
|
||||
|
||||
netlink_parse_rtattr_nested(tb_encap, 256, tb);
|
||||
netlink_parse_rtattr_nested(tb_encap, SEG6_IPTUNNEL_MAX, tb);
|
||||
|
||||
/*
|
||||
* TODO: It's not support multiple SID list.
|
||||
|
Loading…
Reference in New Issue
Block a user