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

Date_t and Duration addition can overflow

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.0.6, 4.1.7
    • Affects Version/s: None
    • Component/s: Internal Code
    • None
    • Fully Compatible
    • v4.0
    • Sharding 2018-12-17

      The following code leads to a silent overflow:

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

      This should throw an exception instead.

            Assignee:
            matthew.saltz@mongodb.com Matthew Saltz (Inactive)
            Reporter:
            matthew.saltz@mongodb.com Matthew Saltz (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: