mirror of
https://github.com/libvirt/libvirt.git
synced 2026-09-03 20:53:04 -05: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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user