From: Daniel P. Berrange Date: Tue, 11 May 2010 14:34:38 +0000 (-0400) Subject: Fix possible crash in handling IO Error event X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=abb7694211a83b444e7fe7dd46e45c45f4701edb;p=libvirt.git 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 --- diff --git a/src/conf/domain_event.c b/src/conf/domain_event.c index e5bd458347..e88aafea8c 100644 --- a/src/conf/domain_event.c +++ b/src/conf/domain_event.c @@ -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; }