summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libvncserver/rfbserver.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libvncserver/rfbserver.c b/libvncserver/rfbserver.c
index 316f5ba..9b0673c 100644
--- a/libvncserver/rfbserver.c
+++ b/libvncserver/rfbserver.c
@@ -1721,7 +1721,10 @@ rfbBool rfbProcessFileTransfer(rfbClientPtr cl, uint8_t contentType, uint8_t con
#ifdef LIBVNCSERVER_HAVE_LIBZ
/* compressed packet */
nRet = uncompress(compBuff,&nRawBytes,(const unsigned char*)buffer, length);
- retval=write(cl->fileTransfer.fd, (char*)compBuff, nRawBytes);
+ if(nRet == Z_OK)
+ retval=write(cl->fileTransfer.fd, (char*)compBuff, nRawBytes);
+ else
+ retval = -1;
#else
/* Write the file out as received... */
retval=write(cl->fileTransfer.fd, buffer, length);