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

nullptr accessed in processEvents

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Out of scope
    • Affects Version/s: 5.15.0 RC2
    • Fix Version/s: None
    • Component/s: Core: Other
    • Labels:
      None
    • Environment:
      Qt Creator 4.14.2 on macOS.
    • Platform/s:
      All

      Description

      I have a call to QCoreApplication::processEvents() in a thread body.  The debugger halted because in this function:  qcoreapplication.cpp on line 1281, it reads:

      void QCoreApplication::processEvents(QEventLoop::ProcessEventsFlags flags)
      {
          QThreadData *data = QThreadData::current();    
          if (!data->hasEventDispatcher())        
              return;    
          data->eventDispatcher.loadRelaxed()->processEvents(flags);
      }
      

      There is no check on the pointer data which is nullptr and it is then dereferenced to try and call hasEventDispatcher,  Obviously the function should check data is valid before use.

        Attachments

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

          Activity

            People

            Assignee:
            thiago Thiago Macieira
            Reporter:
            simonplatten Simon Platten
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes