Coverity analysis defect 116119: Argument cannot be negative

XMLWordPrintableJSON

    • Fully Compatible
    • ALL
    • Execution Team 2021-01-11, Execution Team 2021-01-25
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Argument cannot be negative

      The negative argument will be interpreted as a very large unsigned value. Negative value used as argument to a function expecting a positive value (for example, size of buffer or allocation)
      /src/mongo/db/storage/ephemeral_for_test/ephemeral_for_test_radix_store.h:2271: REVERSE_NEGATIVE 116119 Passing "context->size() - 2UL" to a parameter that cannot be negative. [Note: The source code implementation of the function has been overridden by a builtin model.]
      /src/mongo/db/storage/ephemeral_for_test/ephemeral_for_test_radix_store.h:2290: REVERSE_NEGATIVE 116119 Assigning: "prevIdx" = "context->size() - 2UL"; now neither can be negative.
      /src/mongo/db/storage/ephemeral_for_test/ephemeral_for_test_radix_store.h:2292: REVERSE_NEGATIVE 116119 You might be using variable "prevIdx" before verifying that it is >= 0.

            Assignee:
            Dan Larkin-York
            Reporter:
            Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: