aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent
diff options
context:
space:
mode:
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Window.c35
1 files changed, 22 insertions, 13 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c
index 367c15841..811b5b565 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Window.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c
@@ -3090,27 +3090,36 @@ static void nxagentReconnectWindow(void * param0, XID param1, void * data_buffer
(void*)pWin, pWin -> drawable.id, nxagentWindow(pWin));
#endif
+ /* FIXME: use XAllocSizeHints() */
#ifdef _XSERVER64
data64 = (unsigned char *) malloc(sizeof(XSizeHints) + 4);
+ if (data64)
+ {
+ for (int i = 0; i < 4; i++)
+ {
+ *(data64 + i) = *(data + i);
+ }
- for (int i = 0; i < 4; i++)
- {
- *(data64 + i) = *(data + i);
- }
-
- *(((int *) data64) + 1) = 0;
+ *(((int *) data64) + 1) = 0;
- for (int i = 8; i < sizeof(XSizeHints) + 4; i++)
- {
- *(data64 + i) = *(data + i - 4);
- }
+ for (int i = 8; i < sizeof(XSizeHints) + 4; i++)
+ {
+ *(data64 + i) = *(data + i - 4);
+ }
- XSizeHints *props = (XSizeHints *) data64;
+ XSizeHints *props = (XSizeHints *) data64;
#else
- XSizeHints *props = (XSizeHints *) data;
+ XSizeHints *props = (XSizeHints *) data;
#endif /* _XSERVER64 */
- hints = *props;
+ hints = *props;
+ }
+ else
+ {
+ #ifdef WARNING
+ fprintf(stderr, "%s: Failed to alloc memory for XSizeHints\n", __func__);
+ #endif
+ }
}
else
{