Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Potential bug in QNativeSocketEngine for windows network sockets
QtWS25 Last Chance

Potential bug in QNativeSocketEngine for windows network sockets

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 1.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    artem_pisarenko
    wrote on last edited by
    #1

    I beleive that QNativeSocketEnginePrivate::nativeWrite() method in src/network/socket/qnativesocketengine_win.cpp
    contains potential bug.
    In case when WSASend() returns success but ret != len, it tries next send, but bytesToSend isn't decreased like it happens in end of cycle (it didn't reached because of continue operator). This causes data buffer overread and wrong data being sent to remote side. This case may never hapen due to current socket configuration or some API specification details, but these factors looks very sensitive to be changed.
    Affected classes: QAbstractSocket, QTcpSocket, QSslSocket.
    Threrefore, piece of code responsible for handling this sort of case should be either fixed or considered to be dead and removed.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      You should rather go to the "bug report system":http://bugreports.qt-project.org and open a new report for that providing as much details as you can (this forum is user oriented). If you could also provide a minimal compilable project to test that behavior, it would be even better.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • A Offline
        A Offline
        artem_pisarenko
        wrote on last edited by
        #3

        Hi,
        I wasn't sure to go there since it's not a bug but just a dangerous thing which may produce potential bug in future. There are nothing to test. My intention was just to point experienced developers to this behavior.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Then you can start by discussing the matter on the interest mailing list

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • A Offline
            A Offline
            artem_pisarenko
            wrote on last edited by
            #5

            I hate mailing lists :) So I posted suggestion "QTBUG-38579":https://bugreports.qt-project.org/browse/QTBUG-38579

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved