Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-2181

Coverity analysis defect 100078: Logically dead code

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Trivial - P5 Trivial - P5
    • 1.8.0
    • Affects Version/s: None
    • Component/s: None
    • None

      Code can never be reached because of a logical contradiction

      Defect 100078 (STATIC_C)
      Checker DEADCODE (subcategory none)
      File: /src/jsonsl/jsonsl.c
      Function jsonsl_util_unescape_ex
      /src/jsonsl/jsonsl.c, line: 1364
      Condition "--len == 0UL", taking false branch. Now the value of "len" is at least 1.
      /src/jsonsl/jsonsl.c, line: 1382
      Decrementing "len". The value of "len" is now at least 1.
      /src/jsonsl/jsonsl.c, line: 1389
      Condition "len < 6UL", taking false branch. Now the value of "len" is at least 6.
      /src/jsonsl/jsonsl.c, line: 1427
      Assigning: "len" -= "5UL".
      /src/jsonsl/jsonsl.c, line: 1347
      Decrementing "len". The value of "len" is now at least 0.
      /src/jsonsl/jsonsl.c, line: 1347
      Condition "len", taking true branch. Now the value of "len" is at least 1.
      /src/jsonsl/jsonsl.c, line: 1354
      Condition "len < 2UL", taking false branch. Now the value of "len" is at least 2.
      /src/jsonsl/jsonsl.c, line: 1364
      Decrementing "len". The value of "len" is now at least 1.
      /src/jsonsl/jsonsl.c, line: 1364
      At condition "-len == 0UL", the value of "-len" must be at least 1.
      /src/jsonsl/jsonsl.c, line: 1364
      The condition "--len == 0UL" cannot be true.
      /src/jsonsl/jsonsl.c, line: 1365
      Execution cannot reach this statement: "break;".

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            xgen-internal-coverity Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: