Undefined behavior passing NaN to a NumberLong

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: 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
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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 (Inactive)
            Reporter:
            Robert Guo (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: