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

TimeSorter comparator int overflow

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.0.0-rc0, 5.0.16
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • v5.0
    • QO 2022-03-21
    • 178

      In document_source_sorter.h:

          struct Comp {
              int operator()(Date_t x, Date_t y) const {
                  return x.toMillisSinceEpoch() - y.toMillisSinceEpoch();
              }
          };
      

      It's pretty easy to overflow this int because 2^32 milliseconds is only a couple months.

            Assignee:
            david.percy@mongodb.com David Percy
            Reporter:
            david.percy@mongodb.com David Percy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: