Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-6209

Coverity analysis defect 114135: Unintentional integer overflow

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • WT10.0.0, 4.4.0-rc6, 4.7.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • 1
    • Storage - Ra 2020-05-18

      An integer overflow occurs, with the result converted to a wider integer type

      Defect 114135 (STATIC_C)
      Checker OVERFLOW_BEFORE_WIDEN (subcategory none)
      File: /test/format/ops.c
      Function prepare_transaction
      /test/format/ops.c, line: 525
      Potentially overflowing expression "mmrand(&tinfo->rnd, 1U, 10U) << longwait" with type "uint32_t" (32 bits, unsigned) is evaluated using 32-bit arithmetic, and then used in a context that expects an expression of type "uint64_t" (64 bits, unsigned).

                      pause_ms = mmrand(&tinfo->rnd, 1, 10) << longwait;
      

            Assignee:
            chenhao.qu@mongodb.com Chenhao Qu
            Reporter:
            xgen-internal-coverity Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: