
On 08/30/2012 01:32 AM, Eric Blake wrote:
[...] That is, I think the real patch here would be simply this (untested) version:
diff --git i/src/util/virnetdevopenvswitch.c w/src/util/virnetdevopenvswitch.c index b903ae4..e8b9f4a 100644 --- i/src/util/virnetdevopenvswitch.c +++ w/src/util/virnetdevopenvswitch.c @@ -59,7 +59,7 @@ int virNetDevOpenvswitchAddPort(const char *brname, const char *ifname, char *ifaceid_ex_id = NULL; char *profile_ex_id = NULL; char *vmid_ex_id = NULL; - virBufferPtr buf; + virBufferPtr buf = NULL;
virMacAddrFormat(macaddr, macaddrstr); virUUIDFormat(ovsport->interfaceID, ifuuidstr); @@ -79,7 +79,7 @@ int virNetDevOpenvswitchAddPort(const char *brname, const char *ifname, ovsport->profileID) < 0) goto out_of_memory; } - if (virtVlan) { + if (virtVlan && virtVlan->tag[0]) {
If you were to believe that virtVlan might be sent with no tags (which isn't the case with my patch applied...), then checking for non-0 virtVLan->tag[0] without checking for non-NULL virtVlan->tag would itself lead to a crash.