From 81289eb624cf93f5b810f3371c2dccd50e0339d5 Mon Sep 17 00:00:00 2001 From: Christian Beier Date: Thu, 26 Apr 2012 20:03:33 +0200 Subject: Properly check return value. This also fixes a compiler warning. --- libvncserver/rfbserver.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libvncserver/rfbserver.c') 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); -- cgit v1.2.1