diff options
| author | Jack Nagel | 2013-07-13 16:38:30 -0500 |
|---|---|---|
| committer | Jack Nagel | 2013-07-13 16:56:43 -0500 |
| commit | 411d0647258de1b54483492d949565daf41282af (patch) | |
| tree | 6d8cb0b394ad172f7fe3b477e72aab3d155d0d50 /Library | |
| parent | 354d60c4c3fdef6b4a2a13d40d023c28994b64cf (diff) | |
| download | homebrew-411d0647258de1b54483492d949565daf41282af.tar.bz2 | |
Handle NULs in link targets in Pathname#resolved_path_exists?
Fixes #19475.
Fixes #21184.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/extend/pathname.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb index 6e582c703..3d9fa4c94 100644 --- a/Library/Homebrew/extend/pathname.rb +++ b/Library/Homebrew/extend/pathname.rb @@ -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 |
