Skip to content

Commit

Permalink
Merge pull request #203 from flibitijibibo/patch-1
Browse files Browse the repository at this point in the history
get_ipc_path: Validate file paths, in case of broken symlinks
  • Loading branch information
TheSpookyCat committed Feb 27, 2023
2 parents dc56c82 + 4e9e830 commit 6903209
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pypresence/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def get_ipc_path(pipe=None):
full_path = os.path.abspath(os.path.join(tempdir, path))
if sys.platform == 'win32' or os.path.isdir(full_path):
for entry in os.scandir(full_path):
if entry.name.startswith(ipc):
if entry.name.startswith(ipc) and os.path.exists(entry):
return entry.path


Expand Down

0 comments on commit 6903209

Please sign in to comment.