[libvirt] [PATCH] umlAutostartDomain: avoid NULL-deref upon virGetLastError failure
Eric Blake
eblake at redhat.com
Mon May 17 15:12:07 UTC 2010
On 05/17/2010 09:09 AM, Jim Meyering wrote:
>> That looks awkward to end with a trailing space. Might it be better to use:
>>
>> err ? err->message : _("unknown reason")
>>
>> At any rate, ACK that this fixes a potential NULL deref.
>
> That's a good point.
> I considered going one step further and changing
> virGetLastError so that it never returns NULL,
> instead returning a pointer to a static buffer where
> err->message is something like "internal failure".
>
> Otherwise, many uses of virGetLastError have to use the
> same awkward idiom:
>
> err ? err->message : "..."
>
> If no one objects to such a change, I'll add it to my low-priority list.
Or even to my list, since I have a pending series on virterror.c cleanups.
--
Eric Blake eblake at redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20100517/98224e5c/attachment-0001.sig>
More information about the libvir-list
mailing list