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

improve handling of NaN value in test-only captrunc command

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Storage Execution
    • Fully Compatible
    • ALL
    • Execution Team 2024-06-10
    • 0

      Our ABUSAN CI builder recently flagged how NaN values are handled by the test-only captrunc command when parsing the n argument:

      src/mongo/bson/bsonobj.cpp:711:32: runtime error: nan is outside the range of representable values of type 'int'
      SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior src/mongo/bson/bsonobj.cpp:711:32 in

      Since zero is not an allowed value for this test command, it should be fine to use BSONElement::safeNumberInt() for this parameter.

            Assignee:
            benety.goh@mongodb.com Benety Goh
            Reporter:
            benety.goh@mongodb.com Benety Goh
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: