Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-18624

Division by 0 in ServerModeReader::handleProgress

    XMLWordPrintable

Details

    Description

      In the function ServerModeReader::handleProgress, on line 420:

      int progress = m_progressStepMinimum
      
      + (((max - min) / (cur - min)) * (m_progressStepMaximum - m_progressStepMinimum));

       

      we can have a division by zero when cur == min, this has happend to me when loading a very big cmake project. In addition the formula looks wrong to calculate the progress, looks to me it should be (perhaps using float instead):

      int progress = m_progressStepMinimum + ((cur - min) / (max - min)) * (m_progressStepMaximum - m_progressStepMinimum));

      Attachments

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

        Activity

          People

            hunger Tobias Hunger
            mmaldacker Max Maldacker
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes