From 9ee4d9a65ece010b6bda01ff360495cd42ac6682 Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Sun, 6 Sep 2020 15:36:17 +0100 Subject: [PATCH] More error checking on the YSF protocol. --- YSFGateway/YSFNetwork.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/YSFGateway/YSFNetwork.cpp b/YSFGateway/YSFNetwork.cpp index 52453ae..e58c832 100644 --- a/YSFGateway/YSFNetwork.cpp +++ b/YSFGateway/YSFNetwork.cpp @@ -98,9 +98,14 @@ CYSFNetwork::~CYSFNetwork() bool CYSFNetwork::open() { + if (m_addrLen == 0U) { + LogError("Unable to resolve the address of the YSF network"); + return false; + } + LogMessage("Opening YSF network connection"); - return m_socket.open(); + return m_socket.open(m_addr); } void CYSFNetwork::setDestination(const std::string& name, const sockaddr_storage& addr, unsigned int addrLen)