From b66a92bb9cf8a5f5a5aa9eb6fc52cee9ee9fba25 Mon Sep 17 00:00:00 2001 From: Andy CA6JAU Date: Mon, 20 Aug 2018 00:47:45 -0300 Subject: [PATCH] Fix other crashes --- P25Control.cpp | 4 ++++ P25NID.cpp | 1 - POCSAGControl.cpp | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/P25Control.cpp b/P25Control.cpp index 22e200aa0..a424ee489 100644 --- a/P25Control.cpp +++ b/P25Control.cpp @@ -595,6 +595,10 @@ unsigned int CP25Control::readModem(unsigned char* data) void CP25Control::writeNetwork() { unsigned char data[100U]; + + if (m_network == NULL) + return; + unsigned int length = m_network->read(data, 100U); if (length == 0U) return; diff --git a/P25NID.cpp b/P25NID.cpp index 20d8f911c..5e057c526 100644 --- a/P25NID.cpp +++ b/P25NID.cpp @@ -98,7 +98,6 @@ CP25NID::~CP25NID() delete[] m_term; delete[] m_tsdu; delete[] m_pdu; - delete[] m_tsdu; } bool CP25NID::decode(const unsigned char* data) diff --git a/POCSAGControl.cpp b/POCSAGControl.cpp index 48e457839..498a0a7a4 100644 --- a/POCSAGControl.cpp +++ b/POCSAGControl.cpp @@ -97,7 +97,8 @@ unsigned int CPOCSAGControl::readModem(unsigned char* data) bool CPOCSAGControl::processData() { - assert(m_network != NULL); + if (m_network == NULL) + return false; unsigned char data[300U]; unsigned int length = m_network->read(data);