mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
conf: Avoid NULL-dereference in virDomainObjGetMessages
All callers currently guarantee flags passed to virDomainObjGetMessages are either zero or contain at least one of the supported flags. But it doesn't mean we should not check for the possibility an unknown flag was the only one passed to virDomainObjGetMessages. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
3a311593e5
commit
a7d77e2587
@ -31472,7 +31472,8 @@ virDomainObjGetMessages(virDomainObj *vm,
|
||||
}
|
||||
}
|
||||
|
||||
(*msgs)[nmsgs] = NULL;
|
||||
if (*msgs)
|
||||
(*msgs)[nmsgs] = NULL;
|
||||
|
||||
rv = nmsgs;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user