From 11075c092277a34fe56283cad9bc0f1e3a649830 Mon Sep 17 00:00:00 2001 From: GoesM <130988564+GoesM@users.noreply.github.com> Date: Wed, 8 May 2024 00:05:37 +0800 Subject: [PATCH] replace throw-error with error-log to avoid UAF mentioned in #4175 (#4180) (#4305) * replace throw-error with error-log to avoid UAF * fix typo --------- Signed-off-by: GoesM Co-authored-by: GoesM --- nav2_util/include/nav2_util/simple_action_server.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nav2_util/include/nav2_util/simple_action_server.hpp b/nav2_util/include/nav2_util/simple_action_server.hpp index 4ee84d3b1d..391369e300 100644 --- a/nav2_util/include/nav2_util/simple_action_server.hpp +++ b/nav2_util/include/nav2_util/simple_action_server.hpp @@ -290,8 +290,8 @@ class SimpleActionServer info_msg("Waiting for async process to finish."); if (steady_clock::now() - start_time >= server_timeout_) { terminate_all(); - completion_callback_(); - throw std::runtime_error("Action callback is still running and missed deadline to stop"); + if (completion_callback_) {completion_callback_();} + error_msg("Action callback is still running and missed deadline to stop"); } }