From 52a285bf4e8d3a78d7211694977f5894a748bdac Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 25 Mar 2013 09:17:52 +0100 Subject: libmount: umount crashes when trying to umount a non-mountpoint Reported-by: Mantas Mikulėnas Signed-off-by: Karel Zak --- libmount/src/context_umount.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libmount/src/context_umount.c') diff --git a/libmount/src/context_umount.c b/libmount/src/context_umount.c index 113c53e07..96ae87ae1 100644 --- a/libmount/src/context_umount.c +++ b/libmount/src/context_umount.c @@ -183,7 +183,7 @@ err: static int lookup_umount_fs(struct libmnt_context *cxt) { const char *tgt; - struct libmnt_fs *fs; + struct libmnt_fs *fs = NULL; int rc; assert(cxt); @@ -198,7 +198,7 @@ static int lookup_umount_fs(struct libmnt_context *cxt) rc = mnt_context_find_umount_fs(cxt, tgt, &fs); if (rc < 0) return rc; - if (!fs) { + if (rc == 1 || !fs) { DBG(CXT, mnt_debug_h(cxt, "umount: cannot find %s in mtab", tgt)); return 0; } -- cgit v1.2.3-55-g7522