Re: [PATCH 2/2] Fix possible crash in handling IO Error event

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05/11/2010 08:36 AM, Daniel P. Berrange wrote:
> 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
> ---
>  src/conf/domain_event.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/src/conf/domain_event.c b/src/conf/domain_event.c
> index e5bd458..e88aafe 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)))) {

ACK.

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]