From e09b463d8adec57a18e7c27ec716a30aab30a55f Mon Sep 17 00:00:00 2001 From: Sung-hun Kim Date: Wed, 22 Jan 2025 14:35:58 +0900 Subject: [PATCH] livedumper: Catch an uncatched exception Class Guardian can raise std::bad_function_call exception if wrong functions provided. In this case, the caller should catch the exception (coverity issue number: 1836347). Change-Id: Ia5ed46fb3d44ff40149a5dc719814b147b405972 Signed-off-by: Sung-hun Kim --- src/livedumper/livedumper.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/livedumper/livedumper.hpp b/src/livedumper/livedumper.hpp index abda9e36..a5909596 100644 --- a/src/livedumper/livedumper.hpp +++ b/src/livedumper/livedumper.hpp @@ -227,6 +227,9 @@ class LiveDumper { m_core.SaveStacks(mem_fd, m_core_file, m_tpids, m_registers); } close(mem_fd); + } catch (std::bad_function_call &e) { + logger.log_error("DumpCore: %s", e.what()); + result = false; } catch (std::system_error &e) { logger.log_error("DumpCore: %s", e.what()); result = false; -- 2.34.1