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

Narrowing conversion of timestamp components in mozjs valuewriter

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.3.0-rc0
    • Affects Version/s: None
    • Component/s: 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

      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"));
        

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

              Created:
              Updated:
              Resolved: