Coverity analysis defect 142653: Overflowed return value

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Server Programmability
    • ALL
    • None
    • 3
    • TBD
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Overflowed return value

      The return value will be too small or even negative, likely resulting in unexpected behavior in a caller that uses the return value. An integer overflow occurs, with the overflowed value used as the return value of the function
      /src/mongo/bson/bsonelement.cpp:462: INTEGER_OVERFLOW 142653 Called function "this->canonicalType()", and a possible return value may be less than zero.
      /src/mongo/bson/bsonelement.cpp:462: INTEGER_OVERFLOW 142653 An assign that casts to a different type, which might trigger an overflow.
      /src/mongo/bson/bsonelement.cpp:464: INTEGER_OVERFLOW 142653 The expression "lt - rt" is considered to have possibly overflowed.
      /src/mongo/bson/bsonelement.cpp:464: INTEGER_OVERFLOW 142653 Assigning: "diff" = "lt - rt".
      /src/mongo/bson/bsonelement.cpp:465: INTEGER_OVERFLOW 142653 "diff", which might have overflowed, is returned from the function.

              Assignee:
              Unassigned
              Reporter:
              Coverity Collector User
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: