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

Coverity analysis defect 116119: Argument cannot be negative

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.9.0
    • Affects Version/s: None
    • Component/s: Storage
    • Labels:
    • Fully Compatible
    • ALL
    • Execution Team 2021-01-11, Execution Team 2021-01-25

      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@mongodb.com Dan Larkin-York
            Reporter:
            xgen-internal-coverity Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: