提交 18a1ce77 编写于 作者: J John Ferlan

vbox: Fix possible NULL deref

The @valueTypeUtf8 references need to use the STREQ_NULLABLE since
they're variantly filled in by @valueTypeUtf16.

Found by Coverity.
Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
上级 f5420e60
...@@ -3509,13 +3509,13 @@ vboxDumpDisplay(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine) ...@@ -3509,13 +3509,13 @@ vboxDumpDisplay(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine)
VBOX_UTF8_FREE(valueDisplayUtf8); VBOX_UTF8_FREE(valueDisplayUtf8);
} }
if (STREQ(valueTypeUtf8, "sdl")) { if (STREQ_NULLABLE(valueTypeUtf8, "sdl")) {
graphics->type = VIR_DOMAIN_GRAPHICS_TYPE_SDL; graphics->type = VIR_DOMAIN_GRAPHICS_TYPE_SDL;
graphics->data.sdl.display = valueDisplayUtf8; graphics->data.sdl.display = valueDisplayUtf8;
valueDisplayUtf8 = NULL; valueDisplayUtf8 = NULL;
} }
if (STREQ(valueTypeUtf8, "gui")) { if (STREQ_NULLABLE(valueTypeUtf8, "gui")) {
graphics->type = VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP; graphics->type = VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP;
graphics->data.desktop.display = valueDisplayUtf8; graphics->data.desktop.display = valueDisplayUtf8;
valueDisplayUtf8 = NULL; valueDisplayUtf8 = NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册