[pve-devel] [PATCH common] add missing check for undef in is_mounted

Fabian Grünbichler f.gruenbichler at proxmox.com
Wed Mar 16 15:24:05 CET 2016


---
 src/PVE/ProcFSTools.pm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/PVE/ProcFSTools.pm b/src/PVE/ProcFSTools.pm
index 516c0e8..eadb4e6 100644
--- a/src/PVE/ProcFSTools.pm
+++ b/src/PVE/ProcFSTools.pm
@@ -323,6 +323,8 @@ sub is_mounted {
 
     $mountpoint = Cwd::realpath($mountpoint);
 
+    return 0 if !defined($mountpoint); # path does not exist
+
     my $mounts = parse_proc_mounts();
     return (grep { $_->[1] eq $mountpoint } @$mounts) ? 1 : 0;
 }
-- 
2.1.4





More information about the pve-devel mailing list