summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--src/lib/util/corefile.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lib/util/corefile.cpp b/src/lib/util/corefile.cpp
index 8cb8deea8f2..e681c0f1fac 100644
--- a/src/lib/util/corefile.cpp
+++ b/src/lib/util/corefile.cpp
@@ -1260,6 +1260,8 @@ std::string_view core_filename_extract_base(std::string_view name, bool strip_ex
{
// find the start of the basename
auto const start = std::find_if(name.rbegin(), name.rend(), &util::is_directory_separator);
+ if (start == name.rbegin())
+ return std::string_view();
// find the end of the basename
auto const chop_position = strip_extension