From 50809e35a93fffa16d8493a21546c2c783342e90 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 25 Sep 2023 18:07:28 +0200 Subject: [PATCH] some nullptr checks --- CHANGELOG.md | 4 ++++ linux/payload/PlocSupervisorHandler.cpp | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 71a73eda..1ae7901e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,10 @@ will consitute of a breaking change warranting a new major release: parameters better configurable. This should not affect the behaviour of the OBSW, but might make it more reliable and fix some corner cases. +## Fixed + +- Missing `nullptr` checks for PLOC Supervisor handler, which could lead to crashes. + # [v6.6.0] 2023-09-18 ## Changed diff --git a/linux/payload/PlocSupervisorHandler.cpp b/linux/payload/PlocSupervisorHandler.cpp index 9e0d43d7..0aaa7cfb 100644 --- a/linux/payload/PlocSupervisorHandler.cpp +++ b/linux/payload/PlocSupervisorHandler.cpp @@ -1533,7 +1533,13 @@ void PlocSupervisorHandler::disableAllReplies() { /* Disable ack reply */ iter = deviceReplyMap.find(ACK_REPORT); + if (iter == deviceReplyMap.end()) { + return; + } DeviceReplyInfo* info = &(iter->second); + if (info == nullptr) { + return; + } info->delayCycles = 0; info->command = deviceCommandMap.end();