From 18a1ce77b60cef9084c3bee01b2abb24f1c14586 Mon Sep 17 00:00:00 2001 From: John Ferlan Date: Sun, 3 Nov 2019 07:05:15 -0500 Subject: [PATCH] vbox: Fix possible NULL deref MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The @valueTypeUtf8 references need to use the STREQ_NULLABLE since they're variantly filled in by @valueTypeUtf16. Found by Coverity. Signed-off-by: John Ferlan Reviewed-by: Daniel P. Berrangé --- src/vbox/vbox_common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c index 5486e5ff3b..cdbec15dae 100644 --- a/src/vbox/vbox_common.c +++ b/src/vbox/vbox_common.c @@ -3509,13 +3509,13 @@ vboxDumpDisplay(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine) VBOX_UTF8_FREE(valueDisplayUtf8); } - if (STREQ(valueTypeUtf8, "sdl")) { + if (STREQ_NULLABLE(valueTypeUtf8, "sdl")) { graphics->type = VIR_DOMAIN_GRAPHICS_TYPE_SDL; graphics->data.sdl.display = valueDisplayUtf8; valueDisplayUtf8 = NULL; } - if (STREQ(valueTypeUtf8, "gui")) { + if (STREQ_NULLABLE(valueTypeUtf8, "gui")) { graphics->type = VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP; graphics->data.desktop.display = valueDisplayUtf8; valueDisplayUtf8 = NULL; -- GitLab