aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs
diff options
context:
space:
mode:
Diffstat (limited to 'nx-X11/programs')
-rw-r--r--nx-X11/programs/Xserver/os/io.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/nx-X11/programs/Xserver/os/io.c b/nx-X11/programs/Xserver/os/io.c
index 07399438e..6eeee349a 100644
--- a/nx-X11/programs/Xserver/os/io.c
+++ b/nx-X11/programs/Xserver/os/io.c
@@ -1120,7 +1120,12 @@ FlushClient(ClientPtr who, OsCommPtr oc, const void *__extraBuf, int extraCount)
unsigned char *obuf = NULL;
if (notWritten + BUFSIZE <= INT_MAX) {
- obuf = realloc(oco->buf, notWritten + BUFSIZE);
+ obuf = calloc(1, notWritten + BUFSIZE);
+ if (obuf)
+ {
+ memmove(obuf, oco->buf, oco->size);
+ free(oco->buf);
+ }
}
if (!obuf)
{