aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/os
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2018-07-03 16:20:55 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2018-07-03 16:20:55 +0200
commitce83b566a276797120cef5dc0269309907ba612f (patch)
treee6c9306dac6aef428ab37e678c690f63856c48ba /nx-X11/programs/Xserver/os
parent9834951239bbbfb24dfc919b7e321e21e14d3222 (diff)
parentb394eac8f79773dbe8e40f62e2aeb5c49bf7f65d (diff)
downloadnx-libs-ce83b566a276797120cef5dc0269309907ba612f.tar.gz
nx-libs-ce83b566a276797120cef5dc0269309907ba612f.tar.bz2
nx-libs-ce83b566a276797120cef5dc0269309907ba612f.zip
Merge branch 'uli42-pr/misc' into 3.6.x
Attributes GH PR #712: https://github.com/ArcticaProject/nx-libs/pull/712
Diffstat (limited to 'nx-X11/programs/Xserver/os')
-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)
{