From 17cd200cd17ccb1ecc055bd79a2f271e4bf3b3bd Mon Sep 17 00:00:00 2001 From: proddy Date: Sun, 22 Nov 2020 21:13:04 +0100 Subject: [PATCH] prevent crash on "call system send" with no data --- src/telegram.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/telegram.cpp b/src/telegram.cpp index 350621e08..dfca8afca 100644 --- a/src/telegram.cpp +++ b/src/telegram.cpp @@ -508,6 +508,10 @@ void TxService::read_request(const uint16_t type_id, const uint8_t dest, const u // Send a raw telegram to the bus, telegram is a text string of hex values void TxService::send_raw(const char * telegram_data) { + if (telegram_data == nullptr) { + return; + } + // since the telegram data is a const, make a copy. add 1 to grab the \0 EOS char telegram[EMS_MAX_TELEGRAM_LENGTH * 3]; for (uint8_t i = 0; i < strlen(telegram_data); i++) {