Uploaded image for project: 'Qt Safe Renderer'
  1. Qt Safe Renderer
  2. QSR-2736

Duplicate Assignment to m_stateID with Missing Initialization for m_eventID in StateManager Constructor

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • QSR 3.0, QSR 2.2 Beta2
    • QSR 1.1, QSR 1.2, QSR 2.0, QSR 2.1
    • Runtime
    • None
    • 86470dd3a (2.2), 0822e514e (dev)

    Description

      In the StateManager constructor, the code block that initializes the m_connections array incorrectly assigns the m_stateID field twice while the m_eventID field remains uninitialized. 

              // Null the connections structure
              const quint32 numberOfConnections =
                      static_cast<quint32>(sizeof(m_connections) / sizeof(Connection));
              for (quint32 k = 0U; k < numberOfConnections; ++k) {
                  m_connections[k].m_stateID = 0U;
                  m_connections[k].m_stateID = 0U;
              } 

      The issue should not cause side effects as the m_eventID is properly set during the connect function, and m_connectionsCount is initialized to 0, ensuring no uninitialized connections are accessed. Nonetheless, correcting this code can prevent potential future errors and improve the maintainability and clarity of the codebase.

      Attachments

        For Gerrit Dashboard: QSR-2736
        # Subject Branch Project Status CR V

        Activity

          People

            teemu.holappa Teemu Holappa
            teemu.holappa Teemu Holappa
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes