aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/os/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'nx-X11/programs/Xserver/os/io.c')
-rw-r--r--nx-X11/programs/Xserver/os/io.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/nx-X11/programs/Xserver/os/io.c b/nx-X11/programs/Xserver/os/io.c
index f4da96518..4dc1e7a34 100644
--- a/nx-X11/programs/Xserver/os/io.c
+++ b/nx-X11/programs/Xserver/os/io.c
@@ -1087,10 +1087,11 @@ FlushClient(ClientPtr who, OsCommPtr oc, const void *__extraBuf, int extraCount)
if (notWritten > oco->size)
{
- unsigned char *obuf;
+ unsigned char *obuf = NULL;
- obuf = (unsigned char *)realloc(oco->buf,
- notWritten + BUFSIZE);
+ if (notWritten + BUFSIZE <= INT_MAX) {
+ obuf = realloc(oco->buf, notWritten + BUFSIZE);
+ }
if (!obuf)
{
_XSERVTransDisconnect(oc->trans_conn);