diff options
author | Christian Beier <dontmind@freeshell.org> | 2012-04-26 20:03:33 +0200 |
---|---|---|
committer | Christian Beier <dontmind@freeshell.org> | 2012-04-26 20:03:33 +0200 |
commit | 81289eb624cf93f5b810f3371c2dccd50e0339d5 (patch) | |
tree | b1fec2a47e4f8b5c4d982ebcd1090e8e502c4479 /libvncserver/rfbserver.c | |
parent | cdf8a18c13ae3786068a5b3184d32014775a580a (diff) | |
download | libtdevnc-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.c | 5 |
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); |