Opened 4 years ago

Last modified 4 years ago

#12068 new Bug report

Event Handle Leak Bugfix submission for winsftp.c (in fzsftp.exe)

Reported by: Tobias Giesen Owned by:
Priority: normal Component: FileZilla Client
Keywords: Cc:
Component version: Operating system type: Windows
Operating system version:

Description

Hello,

when downloading a larger file, fzsftp.exe creates hundreds and thousands
of Windows events.

Here's the simple fix for the do_select function, around line 545 of
winsftp.c:

if ((netevent==0)
(netevent==INVALID_HANDLE_VALUE))

netevent = CreateEvent(NULL, false, false, NULL);

I have submitted this fix to the PuTTY project also, but I am unsure if they will read my email.

Attachments (2)

0001-Stop-spuriously-setting-startup-flag-when-calling-do.patch (1.4 KB ) - added by Tobias Giesen 4 years ago.
Patch from the PuTTY Project
0001-winsftp.c-avoid-creating-multiple-netevents.patch (4.3 KB ) - added by Tobias Giesen 4 years ago.
Final (Correted)Patch from the PuTTY Project

Download all attachments as: .zip

Change History (9)

comment:1 by Tobias Giesen, 4 years ago

The source code was apparently broken by pasting, please add the logical OR operator where appropriate.

comment:2 by Tobias Giesen, 4 years ago

maybe this should be added?

else

ResetEvent(netevent);

comment:3 by Tobias Giesen, 4 years ago

I got a reply from PuTTY team with an alternate fix which I'm testing now.

comment:4 by Tim Kosse, 4 years ago

Status: newmoreinfo

That's an interesting bug. Something changed in PuTTY a while ago that causes this bug to be triggered, yet it has existed unnoticed for quite some time.

Would you mind sharing the fix the PuTTY team has in mind?

by Tobias Giesen, 4 years ago

Patch from the PuTTY Project

comment:5 by Tobias Giesen, 4 years ago

Status: moreinfonew

Hello,
I have added the patch as an attachment.

comment:6 by Tobias Giesen, 4 years ago

Hello,
after some testing, I prefer my original fix. The other patch seems to be preventing downloads from starting. I think my fix will be good enough for the moment.

by Tobias Giesen, 4 years ago

Final (Correted)Patch from the PuTTY Project

comment:7 by Tobias Giesen, 4 years ago

Hello,
I received a corrected patch from the PuTTY team, which works fine. I have attached it here (the second attachment).

Note: See TracTickets for help on using tickets.