]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Unity/X11: Gracefully handle NULL desktop work area RPCs.
authorVMware, Inc <>
Tue, 29 Mar 2011 18:54:21 +0000 (11:54 -0700)
committerMarcelo Vanzin <mvanzin@vmware.com>
Tue, 29 Mar 2011 18:54:21 +0000 (11:54 -0700)
Should the host UI issue an RPC like
unity.desktop.work_area.set 0
Unity/X11 will explode with a NULL pointer dereference, because of
an incorrect assumption that there would be at least 1 parameter.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/services/plugins/unity/unitylib/unityPlatformX11.cc

index e62cdf8720e62cf6c0e1925b409dd94834215cdd..8c46380b2f5778eba6c030de3a207c3ff18b5c6c 100644 (file)
@@ -2293,6 +2293,13 @@ UnityPlatformSetDesktopWorkAreas(UnityPlatform *up,     // IN
       screenInfo->height = rootHeight;
    }
 
+   if ((uint32)numScreens != numWorkAreas) {
+      Warning("Mismatch between host-specified work areas and available "
+              "screens.  Request dropped.\n");
+      free(screenInfo);
+      return FALSE;
+   }
+
    /*
     * New and improved wild'n'crazy scheme to map the host's work area
     * coordinates to a collection of struts.