From: Christian Beier <dontmind@freeshell.org>
Date: Mon, 22 Oct 2018 00:39:50 +0200
Subject: [4/5] tightvnc-filetransfer: when creating a new download thread,
 make sure the previous one ends
Origin: https://github.com/LibVNC/libvncserver/commit/2d939267a176bf4976dbad36399638956ad8cc34
Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2018-15126
Bug-Debian: https://bugs.debian.org/916941
Bug: https://github.com/LibVNC/libvncserver/issues/242

re #242
---
 libvncserver/tightvnc-filetransfer/handlefiletransferrequest.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/libvncserver/tightvnc-filetransfer/handlefiletransferrequest.c
+++ b/libvncserver/tightvnc-filetransfer/handlefiletransferrequest.c
@@ -515,8 +515,7 @@
 		FreeFileTransferMsg(fileDownloadMsg);
 		return;
 	}
-	rtcp->rcft.rcfd.downloadInProgress = FALSE;
-	rtcp->rcft.rcfd.downloadFD = -1;
+	CloseUndoneFileDownload(cl, rtcp);
 
 	if(pthread_create(&rtcp->rcft.rcfd.downloadThread, NULL, RunFileDownloadThread, (void*)
 	cl) != 0) {
