diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2018-07-03 16:20:55 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2018-07-03 16:20:55 +0200 |
commit | ce83b566a276797120cef5dc0269309907ba612f (patch) | |
tree | e6c9306dac6aef428ab37e678c690f63856c48ba /nx-X11/programs/Xserver/os | |
parent | 9834951239bbbfb24dfc919b7e321e21e14d3222 (diff) | |
parent | b394eac8f79773dbe8e40f62e2aeb5c49bf7f65d (diff) | |
download | nx-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.c | 7 |
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) { |