summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libmount/src/tab.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libmount/src/tab.c b/libmount/src/tab.c
index f72dcf1c2..85fd427b5 100644
--- a/libmount/src/tab.c
+++ b/libmount/src/tab.c
@@ -780,6 +780,7 @@ struct libmnt_fs *mnt_table_find_mountpoint(struct libmnt_table *tb,
int direction)
{
char *mnt;
+ struct stat st;
if (!tb || !path || !*path)
return NULL;
@@ -788,6 +789,9 @@ struct libmnt_fs *mnt_table_find_mountpoint(struct libmnt_table *tb,
DBG(TAB, ul_debugobj(tb, "lookup MOUNTPOINT: '%s'", path));
+ if (mnt_stat_mountpoint(path, &st))
+ return NULL;
+
mnt = strdup(path);
if (!mnt)
return NULL;