diff options
author | Karel Zak | 2011-09-12 16:01:42 +0200 |
---|---|---|
committer | Karel Zak | 2011-09-12 16:01:42 +0200 |
commit | 96bc8588b238deccfc1b0204327a53f32b0f52ea (patch) | |
tree | f832d7c4ca972d3db412954dae294f812f0c79ae /libmount/src/tab.c | |
parent | kill: potential null derefence [smatch scan] (diff) | |
download | kernel-qcow2-util-linux-96bc8588b238deccfc1b0204327a53f32b0f52ea.tar.gz kernel-qcow2-util-linux-96bc8588b238deccfc1b0204327a53f32b0f52ea.tar.xz kernel-qcow2-util-linux-96bc8588b238deccfc1b0204327a53f32b0f52ea.zip |
libmount: previously assumed null pointer [smatch scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src/tab.c')
-rw-r--r-- | libmount/src/tab.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libmount/src/tab.c b/libmount/src/tab.c index 1eaa9dc38..c06409d29 100644 --- a/libmount/src/tab.c +++ b/libmount/src/tab.c @@ -506,7 +506,7 @@ struct libmnt_fs *mnt_table_find_srcpath(struct libmnt_table *tb, const char *pa if (path == NULL && src == NULL) return fs; /* source is "none" */ - if (p && strcmp(p, path) == 0) + if (path && p && strcmp(p, path) == 0) return fs; if (!p && src) ntags++; /* mnt_fs_get_srcpath() returs nothing, it's TAG */ @@ -845,7 +845,7 @@ int mnt_table_is_fs_mounted(struct libmnt_table *tb, struct libmnt_fs *fstab_fs) tgt = mnt_fs_get_target(fstab_fs); - if (tgt || src || root) { + if (tgt && src && root) { struct libmnt_iter itr; struct libmnt_fs *fs; @@ -856,8 +856,8 @@ int mnt_table_is_fs_mounted(struct libmnt_table *tb, struct libmnt_fs *fstab_fs) *t = mnt_fs_get_target(fs), *r = mnt_fs_get_root(fs); - if (s && t && r && !strcmp(t, tgt) && - !strcmp(s, src) && !strcmp(r, root)) + if (t && s && r && + !strcmp(t, tgt) && !strcmp(s, src) && !strcmp(r, root)) break; } if (fs) |