Thanks for review, I will update it based on your advise, in addition, the commit message is very common, so also change it to "util: Prevent libvirtd crash from virNetDevOpenvswitchAddPort()", push now. -- Regards, Alex ----- Original Message ----- From: "Eric Blake" <eblake@xxxxxxxxxx> To: "Alex Jia" <ajia@xxxxxxxxxx> Cc: libvir-list@xxxxxxxxxx Sent: Tuesday, August 28, 2012 11:25:02 PM Subject: Re: [PATCH] util: Prevent libvirtd crash On 08/28/2012 04:28 AM, Alex Jia wrote: > * src/util/virnetdevopenvswitch.c (virNetDevOpenvswitchAddPort): avoid libvirtd > crash due to derefing a NULL virtVlan->tag. > > RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=852383 > > Signed-off-by: Alex Jia <ajia@xxxxxxxxxx> > --- > src/util/virnetdevopenvswitch.c | 3 ++- > 1 files changed, 2 insertions(+), 1 deletions(-) > > diff --git a/src/util/virnetdevopenvswitch.c b/src/util/virnetdevopenvswitch.c > index 601d79e..7d38ff8 100644 > --- a/src/util/virnetdevopenvswitch.c > +++ b/src/util/virnetdevopenvswitch.c > @@ -100,7 +100,8 @@ int virNetDevOpenvswitchAddPort(const char *brname, const char *ifname, > virBufferAsprintf(buf, "%d", virtVlan->tag[i]); > } > } else { > - virBufferAsprintf(buf, "tag=%d", virtVlan->tag[0]); > + if (virtVlan->nTags) You could avoid a level of indentation by using 'else if (virtVlan->nTags)' ACK. -- Eric Blake eblake@xxxxxxxxxx +1-919-301-3266 Libvirt virtualization library http://libvirt.org -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list