[PATCH 1/8] vbox: Fix possible NULL deref

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <jferlan@xxxxxxxxxx>
---
 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;
-- 
2.20.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux