Once again, manual marshalling has bitten us in the ass. While working
on bug 522656, I discovered that vmware-user was crashing in the region
code, because it was creating regions with invalid dimensions.
Said regions were created from bogus coordinates like this:
Breakpoint 1, UnityTcloSetDesktopWorkArea (result=0x7fff2ed6e980,
resultLen=0x7fff2ed6e978, name=0x2768d90 "unity.desktop.work_area.set",
args=0x275a1fb " 1 , 0 -195 1600 1200", argsSize=21, clientData=0x0)
at /mts/dbc8-a/rbeasley/p4/hosted09/bora-vmsoft/lib/unity/unity.c:854
854 {
This change adds a test s.t. x and y must be >= 0, and width and height
must be >0.
Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
FALSE);
goto out;
}
+
+ if (workAreas[i].x < 0 || workAreas[i].y < 0 ||
+ workAreas[i].width <= 0 || workAreas[i].height <= 0) {
+ RpcIn_SetRetVals(result, resultLen, "Invalid argument", FALSE);
+ goto out;
+ }
}
if (!UnityPlatformSetDesktopWorkAreas(unity.up, workAreas, count)) {