aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/os/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/os/io.c')
-rw-r--r--xorg-server/os/io.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/xorg-server/os/io.c b/xorg-server/os/io.c
index b95586be3..fcad9cacf 100644
--- a/xorg-server/os/io.c
+++ b/xorg-server/os/io.c
@@ -972,10 +972,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);
_XSERVTransClose(oc->trans_conn);