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

Potential out-of-bounds access in QMainWindowLayout::tabPosition

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • None
    • 5.15
    • Widgets: Main Window

      The enumerator has four valid entries, and the tabPositions array is initialized with 4; however, DockCount is the last entry of the enum, so accessing tabPositions[DockCount] would be out of bounds.

      Since toDockPos() might return DockCount (it explicitly does that), the access of the tabPositions array will access element 5 of an array that has only 4 entries.

      Reported by coverity with Id 218539: https://scan3.coverity.com/reports.htm#v42553/p10113/fileInstanceId=32993532&defectInstanceId=9019438&mergedDefectId=218539

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            vhilshei Volker Hilsheimer
            vhilshei Volker Hilsheimer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes