]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
ip-route: Fix parse_encap_seg6() srh parsing
authorPhil Sutter <phil@nwl.cc>
Thu, 18 Oct 2018 13:44:14 +0000 (15:44 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Mon, 22 Oct 2018 17:05:43 +0000 (10:05 -0700)
In case caller did not specify 'segs' parameter, parse_srh() would read
garbage while iterating over 'segbuf'. Avoid this by initializing
'segbuf' to an empty string.

Fixes: e8493916a8ede ("iproute: add support for SR-IPv6 lwtunnel encapsulation")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
ip/iproute_lwtunnel.c

index 85045d4fff74207d3db5e2d5c4699fbda622a5b0..4ebfaa7cd6826f0dcb7c2fc9f9805299b5068631 100644 (file)
@@ -494,7 +494,7 @@ static int parse_encap_seg6(struct rtattr *rta, size_t len, int *argcp,
        struct seg6_iptunnel_encap *tuninfo;
        struct ipv6_sr_hdr *srh;
        char **argv = *argvp;
-       char segbuf[1024];
+       char segbuf[1024] = "";
        int argc = *argcp;
        int encap = -1;
        __u32 hmac = 0;