Uploaded image for project: 'Santuario'
  1. Santuario
  2. SANTUARIO-474

Better overflow checking

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • C++ 1.7.3
    • C++ 2.0.0
    • C++
    • None

    Description

      While looking at those few remaining compiler warnings, I encountered code in safeBuffer::checkAndExpand like this:

      if (size + 1 < bufferSize) 
              return;
      // Make the new size twice the size of the new string requirement 
      xsecsize_t newBufferSize = size * 2; 
      

      (We're dealing with unsigned quantities here.)
      Shouldn't there be overflow checks everywhere?

      Attachments

        Activity

          People

            scantor Scott Cantor
            wferi Ferenc Wágner
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: