GitHub user jeremyspiegel opened a pull request:

    https://github.com/apache/thrift/pull/761

    THRIFT-3502: C++ TServerSocket passes small buffer to getsockname

    When binding with a port number of 0, TServerSocket::listen calls
    getsockname to retrieve the bound port number. The previous code was
    passing too small a buffer as a parameter, failing on Windows with
    errno 2 and WSAGetLastError WSAEFAULT. This change fixes the issue by
    using struct sockaddr_storage instead of struct sockaddr as the
    parameter buffer.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jeremyspiegel/thrift THRIFT-3502

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/thrift/pull/761.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #761
    
----
commit 2758427b001d01e270d7b8181591e5d9aa20860f
Author: Jeremy Spiegel <[email protected]>
Date:   2015-12-23T00:19:20Z

    THRIFT-3502: C++ TServerSocket passes small buffer to getsockname
    
    When binding with a port number of 0, TServerSocket::listen calls
    getsockname to retrieve the bound port number. The previous code was
    passing too small a buffer as a parameter, failing on Windows with
    errno 2 and WSAGetLastError WSAEFAULT. This change fixes the issue by
    using struct sockaddr_storage instead of struct sockaddr as the
    parameter buffer.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to