From: Søren Holm Date: Fri, 26 Sep 2014 16:35:11 +0000 (+0200) Subject: libmount: don't return root if path contains // or ending / X-Git-Tag: v2.26-rc1~433 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=41510d26ddd9a4c83f8589dded539e2985535dcf;p=thirdparty%2Futil-linux.git libmount: don't return root if path contains // or ending / If the path fx. is /foo/bar/ the initial stripoff will replace the last slash with \0 and return a pointer to that exact \0 character. The same thing will happen if the path contains // somewhere. Signed-off-by: Søren Holm --- diff --git a/libmount/src/tab.c b/libmount/src/tab.c index 011ba54291..2b0a34371d 100644 --- a/libmount/src/tab.c +++ b/libmount/src/tab.c @@ -864,7 +864,7 @@ struct libmnt_fs *mnt_table_find_mountpoint(struct libmnt_table *tb, } p = stripoff_last_component(mnt); - if (!p || !*p) + if (!p) break; } while (mnt && *(mnt + 1) != '\0');