Opened 3 years ago

Closed 3 years ago

#10988 closed Bug report (fixed)

libfilezilla thread.cpp contains a bug

Reported by: ckelsel Owned by:
Priority: critical Component: libfilezilla
Keywords: _beginthreadex Cc:
Component version: Operating system type: Windows
Operating system version:

Description

impl_->handle_ = reinterpret_cast<HANDLE>(_beginthreadex(0, 0, thread_proc, impl_, 0, 0));
if (impl_->handle_ == INVALID_HANDLE_VALUE) {
...
}

_beginthreadex return 0 on error , while compare to INVALID_HANDLE_VALUE(-1)

#define INVALID_HANDLE_VALUE ((HANDLE)(LONG_PTR)-1)

On an error, _beginthreadex returns 0, and errno and _doserrno are set.
https://msdn.microsoft.com/en-us/library/kdzttdcb.aspx

Change History (1)

comment:1 Changed 3 years ago by Tim Kosse

Resolution: fixed
Status: newclosed

Thanks, a fix has been committed to the repository.

Note: See TracTickets for help on using tickets.