From 347dce07ebe4c3b5cf5dac1450eccb708dd7368b Mon Sep 17 00:00:00 2001 From: Matthias Frei Date: Mon, 16 Dec 2019 08:47:19 +0100 Subject: [PATCH] Fix nil-pointer dereference in sciond.Path.String A sciond.Path with a nil-overlay could not be printed. Fixed by using UDPAddr.String instead of manually formatting IP:port. --- go/lib/sciond/apitypes.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/go/lib/sciond/apitypes.go b/go/lib/sciond/apitypes.go index 5c86b6f409..fb8e559d84 100644 --- a/go/lib/sciond/apitypes.go +++ b/go/lib/sciond/apitypes.go @@ -213,8 +213,8 @@ func (p Path) Copy() snet.Path { func (p Path) String() string { hops := p.fmtInterfaces() - return fmt.Sprintf("Hops: [%s] MTU: %d, NextHop: %s:%d", - strings.Join(hops, ">"), p.mtu, p.overlay.IP, p.overlay.Port) + return fmt.Sprintf("Hops: [%s] MTU: %d, NextHop: %s", + strings.Join(hops, ">"), p.mtu, p.overlay) } func (p Path) fmtInterfaces() []string {