Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-38445

Date_t and Duration addition can overflow

    XMLWordPrintable

Details

    • Task
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 4.0.6, 4.1.7
    • Internal Code
    • None
    • Fully Compatible
    • v4.0
    • Sharding 2018-12-17

    Description

      The following code leads to a silent overflow:

      auto badDate = Date_t::max() + Milliseconds(1);
      

      This should throw an exception instead.

      Attachments

        Activity

          People

            matthew.saltz@mongodb.com Matthew Saltz
            matthew.saltz@mongodb.com Matthew Saltz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: