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

Undefined behavior passing NaN to a NumberLong

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.3.14
    • Affects Version/s: 3.3.11
    • Component/s: JavaScript
    • None
    • Fully Compatible
    • ALL
    • Platforms 2016-08-26, Platforms 2016-09-19
    • 0

      https://github.com/mongodb/mongo/blob/6f03bed78373f186632f8d6f8a2d4fdc3e5177ee/src/mongo/scripting/mozjs/numberlong.cpp#L176

      This line is assigning a double to a long, which triggers undefined behavior when the double is a NaN. i.e. NumberLong(NaN)

            Assignee:
            matt.cotter Matt Cotter
            Reporter:
            robert.guo@mongodb.com Robert Guo (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: