[libvirt] [PATCH] nwfilter_ebiptables_driver.c: avoid NULL dereference
Eric Blake
eblake at redhat.com
Mon Mar 29 17:19:04 UTC 2010
On 03/29/2010 10:37 AM, Jim Meyering wrote:
> Another one caught by clang:
>
> Note the first test to see if "inst" may be NULL.
> Then, in the following loop, "inst" is unconditionally
> dereferenced via "inst[i]". There are other unprotected
> used of "inst[i]" below, too.
>
> Rather than trying to protect all uses, one by one, I chose
> to return "success" when given an empty list of rules.
ACK that your patch is the minimal fix to avoid a segfault, but we
should probably get Stefan's input on whether returning success on an
empty input is the best course of behavior.
--
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: 323 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20100329/04c11234/attachment-0001.sig>
More information about the libvir-list
mailing list