Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-14822

fassert on _fd in Socket::doSSLHandshake should actually be on fd >= 0

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Trivial - P5 Trivial - P5
    • 3.3.10
    • Affects Version/s: None
    • Component/s: Networking
    • Labels:
    • Fully Compatible
    • ALL
    • Platforms 16 (06/24/16), Platforms 17 (07/15/16)

      I suspect that this fassert is incorrect. It seams that -1 is the invalid value and that 0 and higher are valid values.

      diff --git a/src/mongo/util/net/sock.cpp b/src/mongo/util/net/sock.cpp
      index bdab735..b88747b 100644
      --- a/src/mongo/util/net/sock.cpp
      +++ b/src/mongo/util/net/sock.cpp
      @@ -493,7 +493,7 @@ namespace mongo {
       
           std::string Socket::doSSLHandshake(const char* firstBytes, int len) {
               if (!_sslManager) return "";
      -        fassert(16506, _fd);
      +        fassert(16506, _fd >=0 );
               if (_sslConnection.get()) {
                   throw SocketException(SocketException::RECV_ERROR, 
                                         "Attempt to call SSL_accept on already secure Socket from " +
      

            Assignee:
            matt.cotter Matt Cotter
            Reporter:
            gabriel.russell@mongodb.com Gabriel Russell (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: