From 2072ca4ade68e6733aaee3374cef5726c8e6a54b Mon Sep 17 00:00:00 2001 From: csoler Date: Tue, 26 Jan 2016 22:08:17 -0500 Subject: [PATCH] fixed bug in getPeerDetails causing callstacks to be displayed for non initialised IPs --- libretroshare/src/rsserver/p3peers.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/libretroshare/src/rsserver/p3peers.cc b/libretroshare/src/rsserver/p3peers.cc index a1cb0f351..d5d55c53e 100644 --- a/libretroshare/src/rsserver/p3peers.cc +++ b/libretroshare/src/rsserver/p3peers.cc @@ -296,8 +296,17 @@ bool p3Peers::getPeerDetails(const RsPeerId& id, RsPeerDetails &d) d.hiddenNodeAddress = ps.hiddenDomain; d.hiddenNodePort = ps.hiddenPort; d.hiddenType = ps.hiddenType; - d.localAddr = sockaddr_storage_iptostring(ps.localaddr); - d.localPort = sockaddr_storage_port(ps.localaddr); + + if(sockaddr_storage_isnull(ps.localaddr)) // that happens if the address is not initialised. + { + d.localAddr = "INVALID_IP"; + d.localPort = 0 ; + } + else + { + d.localAddr = sockaddr_storage_iptostring(ps.localaddr); + d.localPort = sockaddr_storage_port(ps.localaddr); + } d.extAddr = "hidden"; d.extPort = 0; d.dyndns = "";