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

De-referencing c++ iterator without null check may be unsafe

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.12
    • Qt3D
    • None
    • All

    Description

       

      \qt3d\src\render\materialsystem\shadercache.cpp

      L79~
      ===
      auto it = std::lower_bound(programRefs.begin(), programRefs.end(),
      shaderPeerId);

      if (*it != shaderPeerId)

      programRefs.insert(it, shaderPeerId);
      ===

       

      it is possible that "it" will get value programRefs.end(), and according to c++ document dereferencing iterator to end()  will have undefined behavior  

      Attachments

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

        Activity

          People

            seanharmer Sean Harmer
            yifei Yi Fei (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes