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

Coverity analysis defect 162796: Overflowed integer argument

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • 8.1 Required
    • Affects Version/s: None
    • Component/s: None
    • Correctness
    • ALL

      Overflowed integer argument

      The argument will be too small or even negative, likely resulting in unexpected behavior (for example, under-allocation in a memory allocation function). An integer overflow occurs, with the overflowed value used as an argument to a function
      /data/bazel_cache/1de52aaeb35278243ca29a4785ce7969/execroot/_main_/src/mongo/shell/shell_utils.cpp:271: INTEGER_OVERFLOW 162796 Called function "mongo::<unnamed>::skipOverString(code, i + 1UL, code[i])", and a possible return value is known to be less than zero.
      /data/bazel_cache/1de52aaeb35278243ca29a4785ce7969/execroot/_main_/src/mongo/shell/shell_utils.cpp:271: INTEGER_OVERFLOW 162796 Assigning: "i" = "mongo::<unnamed>::skipOverString(code, i + 1UL, code[i])".
      /data/bazel_cache/1de52aaeb35278243ca29a4785ce7969/execroot/_main_/src/mongo/shell/shell_utils.cpp:240: INTEGER_OVERFLOW 162796 The expression "i + 1UL" is considered to have possibly overflowed.
      /data/bazel_cache/1de52aaeb35278243ca29a4785ce7969/execroot/_main_/src/mongo/shell/shell_utils.cpp:240: INTEGER_OVERFLOW 162796 "i + 1UL", which might have overflowed, is passed to "code[i + 1UL]". [Note: The source code implementation of the function has been overridden by a builtin model.]

            Assignee:
            trevor.guidry@mongodb.com Trevor Guidry
            Reporter:
            xgen-internal-coverity Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: