* [iproute PATCH] ip-route: Fix parse_encap_seg6() srh parsing
@ 2018-10-18 13:44 Phil Sutter
2018-10-22 17:08 ` Stephen Hemminger
0 siblings, 1 reply; 2+ messages in thread
From: Phil Sutter @ 2018-10-18 13:44 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: David Lebrun, netdev
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>
---
ip/iproute_lwtunnel.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ip/iproute_lwtunnel.c b/ip/iproute_lwtunnel.c
index 85045d4fff742..4ebfaa7cd6826 100644
--- a/ip/iproute_lwtunnel.c
+++ b/ip/iproute_lwtunnel.c
@@ -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;
--
2.19.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [iproute PATCH] ip-route: Fix parse_encap_seg6() srh parsing
2018-10-18 13:44 [iproute PATCH] ip-route: Fix parse_encap_seg6() srh parsing Phil Sutter
@ 2018-10-22 17:08 ` Stephen Hemminger
0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2018-10-22 17:08 UTC (permalink / raw)
To: Phil Sutter; +Cc: David Lebrun, netdev
On Thu, 18 Oct 2018 15:44:14 +0200
Phil Sutter <phil@nwl.cc> wrote:
> 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>
Applied
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-10-23 1:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-18 13:44 [iproute PATCH] ip-route: Fix parse_encap_seg6() srh parsing Phil Sutter
2018-10-22 17:08 ` Stephen Hemminger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).