From f62496d1640c346b65637c784955a174a38b4830 Mon Sep 17 00:00:00 2001 From: s-hadinger <49731213+s-hadinger@users.noreply.github.com> Date: Wed, 28 Aug 2024 13:04:56 +0200 Subject: [PATCH] Crash when calling TasmotaSerial destructor when initialized with incorrect arguments (#22036) --- CHANGELOG.md | 1 + lib/default/TasmotaSerial-3.6.0/src/TasmotaSerial.cpp | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f81ca1a50..d4f14c5d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ All notable changes to this project will be documented in this file. - Zigbee extend timeout for MCU reboot from 5s to 10s (#22009) - Matter fix when Rules are disabled (#22016) - BearSSL panic on ESP8266 in rare conditions (#22017) +- Crash when calling TasmotaSerial destructor when initialized with incorrect arguments ### Removed diff --git a/lib/default/TasmotaSerial-3.6.0/src/TasmotaSerial.cpp b/lib/default/TasmotaSerial-3.6.0/src/TasmotaSerial.cpp index 2200e06ba..ef8f87596 100644 --- a/lib/default/TasmotaSerial-3.6.0/src/TasmotaSerial.cpp +++ b/lib/default/TasmotaSerial-3.6.0/src/TasmotaSerial.cpp @@ -123,7 +123,9 @@ void TasmotaSerial::end(void) { } TasmotaSerial::~TasmotaSerial(void) { - end(); + if (m_valid) { + end(); + } } bool TasmotaSerial::isValidGPIOpin(int pin) {