From: VMware, Inc <> Date: Thu, 24 Feb 2011 22:42:29 +0000 (-0800) Subject: GHI/X11: Don't pass NULL to strcmp. X-Git-Tag: 2011.02.23-368700~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee7bdea1d7cc2567914b34dcb860788181b5fe3e;p=thirdparty%2Fopen-vm-tools.git GHI/X11: Don't pass NULL to strcmp. Xdg_DetectDesktopEnv may return NULL, so its return value shouldn't be passed to strcmp unchecked. Rather than checking ourselves, we'll just g_strcmp0 do it for us. Signed-off-by: Marcelo Vanzin --- diff --git a/open-vm-tools/services/plugins/unity/ghIntegration/platform.cc b/open-vm-tools/services/plugins/unity/ghIntegration/platform.cc index f0c306c2f..44b4f4447 100644 --- a/open-vm-tools/services/plugins/unity/ghIntegration/platform.cc +++ b/open-vm-tools/services/plugins/unity/ghIntegration/platform.cc @@ -240,7 +240,8 @@ Bool GHIPlatformIsSupported(void) { const char *desktopEnv = Xdg_DetectDesktopEnv(); - return (strcmp(desktopEnv, "GNOME") == 0) || (strcmp(desktopEnv, "KDE") == 0); + return (g_strcmp0(desktopEnv, "GNOME") == 0) + || (g_strcmp0(desktopEnv, "KDE") == 0); }