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

Use-after-delete happens in QMultiMap::remove

    XMLWordPrintable

Details

    • Linux/X11
    • 2ba1d540e6175d06c21be86614704f9e56eb5d96

    Description

      The following code snippet causes invalid memory read (please see attached Valgrind output):

      #include <QMultiMap>
      int main()
      {
          QMultiMap<int, QString> mm;
          mm.insert(1, "one");
          mm.insert(1, "eins");
          mm.insert(1, "uno");
          auto it = mm.find(1);
          Q_ASSERT(it != mm.cend());
          mm.remove(it.key(), it.value());
          return 0;
      }
      

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            dkhlopov dkhlopov
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes