chriskohlhoff / asio

Asio C++ Library
http://think-async.com/Asio
4.73k stars 1.2k forks source link

Fix possible loss of socket descriptor in reactor_op_cancellation on 64-bit platforms #1308

Open antrv opened 1 year ago

antrv commented 1 year ago

The descriptor_ field of reactor_op_cancellation has int type and it is used to store the socket descriptor, but in 64-bit Windows the SOCKET type is an alias of ULONG_PTR and has size of 64 bits.

This may cause:

This pull requests fixes the issue.

antrv commented 1 year ago

resolves https://github.com/chriskohlhoff/asio/issues/1309