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

Better overflow checking

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: C++ 1.7.3
    • Fix Version/s: C++ 2.0.0
    • Component/s: C++
    • Labels:
      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

            • Assignee:
              scantor Scott Cantor
              Reporter:
              wferi Ferenc W√°gner
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: