From a1e1838b1192979344027152c6306b33a8a56575 Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Wed, 15 Oct 2025 11:41:44 -0700 Subject: [PATCH] FEXpidof: Fixes potential crash Trivial fix, if a symlink gets deleted between checking if it is a symlink versus getting a path of it then it resulted in a crash. Happened periodically for me. --- Source/Tools/pidof/pidof.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Source/Tools/pidof/pidof.cpp b/Source/Tools/pidof/pidof.cpp index 59ffede5e..27f085e71 100644 --- a/Source/Tools/pidof/pidof.cpp +++ b/Source/Tools/pidof/pidof.cpp @@ -93,7 +93,14 @@ bool FindWineFEXApplication(int64_t PID, std::string_view exe, const std::vector continue; } - const auto filename = std::filesystem::read_symlink(Entry.path()).filename().string(); + std::error_code ec {}; + const auto symlink_path = std::filesystem::read_symlink(Entry.path(), ec); + // If error reading symlink then skip. + if (ec) { + continue; + } + + const auto filename = symlink_path.filename().string(); if (filename.find("arm64ecfex.dll") != filename.npos || filename.find("wow64fex.dll") != filename.npos) { return true; }