提交 814fcb9e 编写于 作者: A Alex Jia

conf: Prevent crash of libvirtd without channel target name

* src/conf/domain_conf.c (virDomainChannelDefCheckABIStability): avoid
  crashing libvirtd due to derefing a NULL pointer.

For details, please see bug:
RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=808371Signed-off-by: NAlex Jia <ajia@redhat.com>
上级 ff68d6ee
...@@ -9597,10 +9597,10 @@ static bool virDomainChannelDefCheckABIStability(virDomainChrDefPtr src, ...@@ -9597,10 +9597,10 @@ static bool virDomainChannelDefCheckABIStability(virDomainChrDefPtr src,
switch (src->targetType) { switch (src->targetType) {
case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO: case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO:
if (STRNEQ(src->target.name, dst->target.name)) { if (STRNEQ_NULLABLE(src->target.name, dst->target.name)) {
virDomainReportError(VIR_ERR_CONFIG_UNSUPPORTED, virDomainReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Target channel name %s does not match source %s"), _("Target channel name %s does not match source %s"),
dst->target.name, src->target.name); NULLSTR(dst->target.name), NULLSTR(src->target.name));
goto cleanup; goto cleanup;
} }
break; break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册