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

Coverity analysis defect 122257: Misuse of memcmp-style function

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.0.0-rc8, 6.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Fully Compatible
    • ALL
    • v6.0
    • Sharding NYC 2022-06-13

      Misuse of memcmp-style function

      The return value may be misinterpreted if the function returns an unexpected value. A memcmp-style function is used assuming that it returns -1, 0, or 1.
      /src/mongo/db/transaction_participant.cpp:187: BAD_COMPARE 122257 The return value of "find" is not of the type boolean. Note that "find" returns the position of the start of the substring that matches the search criteria or std::string::npos if the search was unsuccessful.

            Assignee:
            jack.mulrow@mongodb.com Jack Mulrow
            Reporter:
            xgen-internal-coverity Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: