Coverity analysis defect 174760: Uninitialized scalar variable

XMLWordPrintableJSON

    • Storage Engines, Storage Engines - Persistence
    • SE Persistence - 2025-08-29
    • 2

      Uninitialized scalar variable

      The variable will contain an arbitrary value left from earlier computations. Use of an uninitialized variable
      /src/block_cache/block_io.c:63: UNINIT 174760 Declaring variable "block_meta_tmp" without initializer.
      /src/block_cache/block_io.c:151: UNINIT 174760 Using uninitialized value "block_meta_tmp".

       

      The real reason why I created a ticket for this coverity report is not what is described above. The case I am curious about is what if during the execution of `_wt_blkcache_read` we don't initialize `block_meta_tmp` because `found == false` but later still pass a pointer to `block_meta_tmp` to `_wti_blkcache_put` which could read a garbage data from it.

              Assignee:
              Albert Song
              Reporter:
              Coverity Collector User
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: