From: Laine Stump Date: Thu, 20 Feb 2014 11:59:55 +0000 (+0200) Subject: conf: handle null pointer in virNetDevVlanFormat X-Git-Tag: v1.2.2-rc2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=79358733b090b3b15a8d18da8e8b0964c9edf5e1;p=thirdparty%2Flibvirt.git conf: handle null pointer in virNetDevVlanFormat Other *Format() functions (e.g. virNetDevBandwidthFormat()) return with no action when called with a NULL *Def pointer. This makes virNetDevVlanFormat() consistent with that behavior. --- diff --git a/src/conf/netdev_vlan_conf.c b/src/conf/netdev_vlan_conf.c index f58b4b8fd7..dbe203e8f9 100644 --- a/src/conf/netdev_vlan_conf.c +++ b/src/conf/netdev_vlan_conf.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2013 Red Hat, Inc. + * Copyright (C) 2009-2014 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -144,7 +144,7 @@ virNetDevVlanFormat(const virNetDevVlan *def, virBufferPtr buf) { size_t i; - if (def->nTags == 0) + if (!(def && def->nTags)) return 0; if (!def->tag) {