提交 79358733 编写于 作者: L Laine Stump

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.
上级 6d4ffae4
/*
* 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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册