提交 bf72ab16 编写于 作者: J Julio Faracco 提交者: Ján Tomko

qemu: fix uninitialised variable in virQEMUDriverConfigLoadFile

Since virConfGetValueBool() can return earlier, the parameter 'value'
might be not initialised properly inside this method. Another proof:
Valgrind is returning this error during the libvirtd daemon startup:

==16199== Conditional jump or move depends on uninitialised value(s)
==16199==    at 0x27FFFEF4: virQEMUDriverConfigLoadFile (qemu_conf.c:809)
==16199==    by 0x2807665C: qemuStateInitialize (qemu_driver.c:654)
==16199==    by 0x5535428: virStateInitialize (libvirt.c:662)
==16199==    by 0x12AED8: daemonRunStateInit (remote_daemon.c:802)
==16199==    by 0x536DE18: virThreadHelper (virthread.c:206)
==16199==    by 0x6CB36DA: start_thread (pthread_create.c:463)
==16199==    by 0x6FEC88E: clone (clone.S:95)
Signed-off-by: NJulio Faracco <jcfaracco@gmail.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
Signed-off-by: NJán Tomko <jtomko@redhat.com>
上级 b6d5be46
......@@ -804,9 +804,9 @@ int virQEMUDriverConfigLoadFile(virQEMUDriverConfigPtr cfg,
goto cleanup;
if (virConfGetValueBool(conf, "clear_emulator_capabilities", &cfg->clearEmulatorCapabilities) < 0)
goto cleanup;
if (virConfGetValueBool(conf, "allow_disk_format_probing", &tmp) < 0)
if ((rv = virConfGetValueBool(conf, "allow_disk_format_probing", &tmp)) < 0)
goto cleanup;
if (tmp) {
if (rv == 1 && tmp) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("allow_disk_format_probing is no longer supported"));
goto cleanup;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册