Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-49255

QNativeSocketEnginePrivate::nativeConnect - relies on outdated SO_ERROR

    XMLWordPrintable

Details

    • 52e335e191130c5beb457e8d07851fc98ceb909a

    Description

      nativeConnect calls WSAConnect, tests its return value then in case of SOCKET_ERROR
      checks WSAGetLastError and calls getsockopt to extract SO_ERROR. This SO_ERROR can
      have a value different from NO_ERROR prior to WSAConnect (and not cleared by WSAConnect)..
      And while handling WSAEWOULDBLOCK we can incorrectly rely on this SO_ERROR's
      value, breaking the logic in QAbstractSocket::_q_connectNextAddress.
      Found in tst_qtcpsocket::bindThenResolveHost failing in this scenario: QHostInfo has a list of invalid/valid addresses.

      Attachments

        For Gerrit Dashboard: QTBUG-49255
        # Subject Branch Project Status CR V

        Activity

          People

            tpochep Timur Pocheptsov
            tpochep Timur Pocheptsov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes