mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 21:34:54 +03:00
Fix possible crash in handling IO Error event
If the IO error event does not include a reason, then there is a possible crash dispatching the event * src/conf/domain_event.c: Missing check for a NULL reason before strduping allows for a crash
This commit is contained in:
parent
ff45b4c26f
commit
abb7694211
@ -671,7 +671,7 @@ static virDomainEventPtr virDomainEventIOErrorNewFromObjImpl(int event,
|
||||
ev->data.ioError.action = action;
|
||||
if (!(ev->data.ioError.srcPath = strdup(srcPath)) ||
|
||||
!(ev->data.ioError.devAlias = strdup(devAlias)) ||
|
||||
!(ev->data.ioError.reason = strdup(reason))) {
|
||||
(reason && !(ev->data.ioError.reason = strdup(reason)))) {
|
||||
virDomainEventFree(ev);
|
||||
ev = NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user