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

Narrowing conversion of timestamp components in mozjs valuewriter

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 6.3.0-rc0
    • None
    • None
    • Fully Compatible
    • ALL
    • QE 2022-09-19, QE 2022-10-03, QE 2022-10-17, QE 2022-10-31, QE 2022-11-14, QE 2022-11-28, QE 2022-12-12, QE 2022-12-26
    • 59

    Description

      We could experience some unexpected, implementation-defined behavior if the components of the timestamp are doubles with values outside the allowed integer range.

      src/mongo/scripting/mozjs/valuewriter.cpp:302:22: warning: narrowing conversion from 'double' to 'unsigned int' [bugprone-narrowing-conversions]
          return Timestamp(wrapper.getNumber("t"), wrapper.getNumber("i"));
                           ^
      src/mongo/scripting/mozjs/valuewriter.cpp:302:46: warning: narrowing conversion from 'double' to 'unsigned int' [bugprone-narrowing-conversions]
          return Timestamp(wrapper.getNumber("t"), wrapper.getNumber("i"));
                                                   ^
      src/mongo/scripting/mozjs/valuewriter.cpp:453:30: warning: narrowing conversion from 'double' to 'unsigned int' [bugprone-narrowing-conversions]
                      Timestamp ot(o.getNumber("t"), o.getNumber("i"));
                                   ^
      src/mongo/scripting/mozjs/valuewriter.cpp:453:48: warning: narrowing conversion from 'double' to 'unsigned int' [bugprone-narrowing-conversions]
                      Timestamp ot(o.getNumber("t"), o.getNumber("i"));
        

      Attachments

        Issue Links

          Activity

            People

              justin.seyster@mongodb.com Justin Seyster
              dan.larkin-york@mongodb.com Dan Larkin-York
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: