1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

activation: dso always defined for monitoring query

Ensure 'dso' has always a defined (NULL) value,
and also ensure NULL 'dso' is not dereferenced.
This commit is contained in:
Zdenek Kabelac 2016-09-12 16:37:31 +02:00
parent 06c7220f78
commit b592ea5bbc
2 changed files with 3 additions and 2 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.166 - Version 2.02.166 -
===================================== =====================================
Fix possible NULL pointer derefence when checking for monitoring.
Add lvmreport(7) man page. Add lvmreport(7) man page.
Don't install lvmraid(7) man page when raid excluded. (2.02.165) Don't install lvmraid(7) man page when raid excluded. (2.02.165)
Report 0% as dirty (copy%) for cache without any used block. Report 0% as dirty (copy%) for cache without any used block.

View File

@ -1707,7 +1707,7 @@ int monitor_dev_for_events(struct cmd_context *cmd, const struct logical_volume
uint32_t s; uint32_t s;
static const struct lv_activate_opts zlaopts = { 0 }; static const struct lv_activate_opts zlaopts = { 0 };
struct lvinfo info; struct lvinfo info;
const char *dso; const char *dso = NULL;
int new_unmonitor; int new_unmonitor;
if (!laopts) if (!laopts)
@ -1855,7 +1855,7 @@ int monitor_dev_for_events(struct cmd_context *cmd, const struct logical_volume
} else { } else {
if (!monitored) if (!monitored)
log_verbose("%s already not monitored.", display_lvname(lv)); 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 * Divert unmonitor away from code that depends on the new segment
* type instead of the existing one if it's changing. * type instead of the existing one if it's changing.