Skip to content
Snippets Groups Projects
Commit 528e750f authored by Jack Nagel's avatar Jack Nagel
Browse files

Handle NULs in link targets in Pathname#resolved_path_exists?

Fixes Homebrew/homebrew#19475.
Fixes Homebrew/homebrew#21184.
parent 7964aa66
No related branches found
No related tags found
No related merge requests found
......@@ -253,7 +253,12 @@ class Pathname
end
def resolved_path_exists?
(dirname+readlink).exist?
link = readlink
rescue ArgumentError
# The link target contains NUL bytes
false
else
(dirname+link).exist?
end
# perhaps confusingly, this Pathname object becomes the symlink pointing to
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment