summaryrefslogtreecommitdiffstats
path: root/libvncserver/rfbserver.c
diff options
context:
space:
mode:
authorChristian Beier <dontmind@freeshell.org>2012-04-26 20:03:33 +0200
committerChristian Beier <dontmind@freeshell.org>2012-04-26 20:03:33 +0200
commit81289eb624cf93f5b810f3371c2dccd50e0339d5 (patch)
treeb1fec2a47e4f8b5c4d982ebcd1090e8e502c4479 /libvncserver/rfbserver.c
parentcdf8a18c13ae3786068a5b3184d32014775a580a (diff)
downloadlibtdevnc-81289eb624cf93f5b810f3371c2dccd50e0339d5.tar.gz
libtdevnc-81289eb624cf93f5b810f3371c2dccd50e0339d5.zip
Properly check return value.
This also fixes a compiler warning.
Diffstat (limited to 'libvncserver/rfbserver.c')
-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);