Re: [libvirt] [PATCH] util: ensure safe{read, write, zero} return is checked

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

 



According to Eric Blake on 3/2/2010 9:40 AM:
> Based on a warning from coverity.  The safe* functions
> guarantee complete transactions on success, but don't guarantee
> freedom from failure.
> 
> * src/util/util.h (saferead, safewrite, safezero): Add
> ATTRIBUTE_RETURN_CHECK.
> * src/remote/remote_driver.c (remoteIO, remoteIOEventLoop): Ignore
> some failures.
> (remoteIOReadBuffer): Adjust error messages on read failure.
> * daemon/event.c (virEventHandleWakeup): Ignore read failure.

This patch can probably wait till after 0.7.7.  Meanwhile,

> -                    saferead(priv->errfd, errout, sizeof(errout));
> +                    if (saferead(priv->errfd, errout, sizeof(errout)) < 0) {
> +                        strncpy (errout, _("unknown reason"), sizeof errout);

I obviously failed to run 'make syntax-check'.  I'll have to send a respin
of this patch with better fix that avoids strncpy.

-- 
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]