mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-02 01:18:26 +03:00
polldaemon: proper error check in _poll_vg fn
could theoretically cause NULL pointer dereference
This commit is contained in:
parent
b9e6e66de1
commit
663254d7a5
@ -191,7 +191,7 @@ static int _wait_for_single_lv(struct cmd_context *cmd, const char *name, const
|
||||
static int _poll_vg(struct cmd_context *cmd, const char *vgname,
|
||||
struct volume_group *vg, struct processing_handle *handle)
|
||||
{
|
||||
struct daemon_parms *parms = (struct daemon_parms *) handle->custom_handle;
|
||||
struct daemon_parms *parms;
|
||||
struct lv_list *lvl;
|
||||
struct dm_list *sls;
|
||||
struct dm_str_list *sl;
|
||||
@ -199,7 +199,7 @@ static int _poll_vg(struct cmd_context *cmd, const char *vgname,
|
||||
const char *name;
|
||||
int finished;
|
||||
|
||||
if (!parms) {
|
||||
if (!handle || !(parms = (struct daemon_parms *) handle->custom_handle)) {
|
||||
log_error(INTERNAL_ERROR "Handle is undefined.");
|
||||
return ECMD_FAILED;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user