diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2016-09-12 16:37:31 +0200 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2016-09-12 16:49:49 +0200 |
commit | b592ea5bbcc9d348fdbacec1b4eeb9dded36d4ab (patch) | |
tree | e1533f28a144bdfae642141238421e760b6dfde9 | |
parent | 06c7220f7805d622d72968fc95c3b2bb46cde877 (diff) | |
download | lvm2-b592ea5bbcc9d348fdbacec1b4eeb9dded36d4ab.tar.gz |
activation: dso always defined for monitoring query
Ensure 'dso' has always a defined (NULL) value,
and also ensure NULL 'dso' is not dereferenced.
-rw-r--r-- | WHATS_NEW | 1 | ||||
-rw-r--r-- | lib/activate/activate.c | 4 |
2 files changed, 3 insertions, 2 deletions
@@ -1,5 +1,6 @@ Version 2.02.166 - ===================================== + Fix possible NULL pointer derefence when checking for monitoring. Add lvmreport(7) man page. Don't install lvmraid(7) man page when raid excluded. (2.02.165) Report 0% as dirty (copy%) for cache without any used block. diff --git a/lib/activate/activate.c b/lib/activate/activate.c index 997729124..69d40a0c5 100644 --- a/lib/activate/activate.c +++ b/lib/activate/activate.c @@ -1707,7 +1707,7 @@ int monitor_dev_for_events(struct cmd_context *cmd, const struct logical_volume uint32_t s; static const struct lv_activate_opts zlaopts = { 0 }; struct lvinfo info; - const char *dso; + const char *dso = NULL; int new_unmonitor; if (!laopts) @@ -1855,7 +1855,7 @@ int monitor_dev_for_events(struct cmd_context *cmd, const struct logical_volume } else { if (!monitored) log_verbose("%s already not monitored.", display_lvname(lv)); - else if (*dso) { + else if (dso && *dso) { /* * Divert unmonitor away from code that depends on the new segment * type instead of the existing one if it's changing. |