提交 1fe6d219 编写于 作者: J Ján Tomko 提交者: Peter Krempa

conf: prevent NULL pointer access in virSecurityLabelDefsParseXML

When checking for seclabels without security models, def->nseclabels is
already set to n. In the case of an error def->seclabels is freed but
nseclabels is left untouched. This leads to a segmentation fault when
def is freed in virDomainDefParseXML.
上级 661d7fb4
...@@ -3179,6 +3179,7 @@ error: ...@@ -3179,6 +3179,7 @@ error:
virSecurityLabelDefFree(def->seclabels[i - 1]); virSecurityLabelDefFree(def->seclabels[i - 1]);
} }
VIR_FREE(def->seclabels); VIR_FREE(def->seclabels);
def->nseclabels = 0;
VIR_FREE(list); VIR_FREE(list);
return -1; return -1;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册