Commit 12712c70 authored by Mike Hibler's avatar Mike Hibler

Watch out for undef return from realpath.

parent d6293463
...@@ -1015,13 +1015,13 @@ sub ParseArgs() ...@@ -1015,13 +1015,13 @@ sub ParseArgs()
# Use realpath to resolve any symlinks. # Use realpath to resolve any symlinks.
# #
my $translated = realpath($tempnsfile); my $translated = realpath($tempnsfile);
if ($translated =~ /^([-\w\.\/]+)$/) { if (defined($translated) && $translated =~ /^([-\w\.\/]+)$/) {
$tempnsfile = $1; $tempnsfile = $1;
} }
else { else {
tbdie({type => 'primary', severity => SEV_ERROR, tbdie({type => 'primary', severity => SEV_ERROR,
error => ['bad_data', 'realpath', $translated]}, error => ['bad_data', 'realpath', $tempnsfile]},
"Bad data returned by realpath: $translated"); "Bad data returned by realpath for: $tempnsfile");
} }
# #
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment