diff --git a/src/common/lookups/TalkgroupRulesLookup.h b/src/common/lookups/TalkgroupRulesLookup.h
index 8cf2c8b0..6687ee9c 100644
--- a/src/common/lookups/TalkgroupRulesLookup.h
+++ b/src/common/lookups/TalkgroupRulesLookup.h
@@ -195,6 +195,13 @@ namespace lookups
return *this;
}
+ /// Gets the count of inclusions.
+ uint8_t inclusionSize() const { return m_inclusion.size(); }
+ /// Gets the count of exclusions.
+ uint8_t exclusionSize() const { return m_exclusion.size(); }
+ /// Gets the count of rewrites.
+ uint8_t rewriteSize() const { return m_rewrite.size(); }
+
/// Return the YAML structure for this TalkgroupRuleConfig.
void getYaml(yaml::Node &node)
{
diff --git a/src/common/network/udp/Socket.cpp b/src/common/network/udp/Socket.cpp
index 3f312c8b..f291c3b4 100644
--- a/src/common/network/udp/Socket.cpp
+++ b/src/common/network/udp/Socket.cpp
@@ -511,7 +511,14 @@ bool Socket::write(BufferVector& buffers, ssize_t* lenWritten) noexcept
bool skip = false;
for (auto& buffer : buffers) {
+ if (buffer == nullptr) {
+ LogError(LOG_NET, "Socket::write() missing network buffer data? this isn't normal, aborting");
+ skip = true;
+ break;
+ }
+
if (m_af != buffer->address.ss_family) {
+ LogError(LOG_NET, "Socket::write() mismatched network address family? this isn't normal, aborting");
skip = true;
break;
}
diff --git a/src/fne/network/fne/TagDMRData.cpp b/src/fne/network/fne/TagDMRData.cpp
index 27d74c00..37551d28 100644
--- a/src/fne/network/fne/TagDMRData.cpp
+++ b/src/fne/network/fne/TagDMRData.cpp
@@ -422,10 +422,9 @@ bool TagDMRData::peerRewrite(uint32_t peerId, uint32_t& dstId, uint32_t& slotNo,
tg = m_network->m_tidLookup->findByRewrite(peerId, dstId);
}
- std::vector rewrites = tg.config().rewrite();
-
bool rewrote = false;
- if (rewrites.size() > 0) {
+ if (tg.config().rewriteSize() > 0) {
+ std::vector rewrites = tg.config().rewrite();
for (auto entry : rewrites) {
if (entry.peerId() == peerId) {
if (outbound) {
diff --git a/src/fne/network/fne/TagNXDNData.cpp b/src/fne/network/fne/TagNXDNData.cpp
index 1bdb1838..09d0dbef 100644
--- a/src/fne/network/fne/TagNXDNData.cpp
+++ b/src/fne/network/fne/TagNXDNData.cpp
@@ -347,10 +347,9 @@ bool TagNXDNData::peerRewrite(uint32_t peerId, uint32_t& dstId, bool outbound)
tg = m_network->m_tidLookup->findByRewrite(peerId, dstId);
}
- std::vector rewrites = tg.config().rewrite();
-
bool rewrote = false;
- if (rewrites.size() > 0) {
+ if (tg.config().rewriteSize() > 0) {
+ std::vector rewrites = tg.config().rewrite();
for (auto entry : rewrites) {
if (entry.peerId() == peerId) {
if (outbound) {
diff --git a/src/fne/network/fne/TagP25Data.cpp b/src/fne/network/fne/TagP25Data.cpp
index 0f41b80a..7829a9d7 100644
--- a/src/fne/network/fne/TagP25Data.cpp
+++ b/src/fne/network/fne/TagP25Data.cpp
@@ -485,9 +485,8 @@ bool TagP25Data::peerRewrite(uint32_t peerId, uint32_t& dstId, bool outbound)
tg = m_network->m_tidLookup->findByRewrite(peerId, dstId);
}
- std::vector rewrites = tg.config().rewrite();
-
- if (rewrites.size() > 0) {
+ if (tg.config().rewriteSize() > 0) {
+ std::vector rewrites = tg.config().rewrite();
for (auto entry : rewrites) {
if (entry.peerId() == peerId) {
if (outbound) {