Fix uninitialized read in doveadm-oldstats
authorChristian Göttsche <cgzones@googlemail.com>
Sat, 23 Jul 2022 14:38:23 +0000 (16:38 +0200)
committerNoah Meyerhans <noahm@debian.org>
Sat, 17 Aug 2024 17:26:24 +0000 (13:26 -0400)
commit5779b73fe3c71dc70484d15eae97b1be19fab561
treea46b331bcb912614e98a282cd6471483e189498d
parent51ebadcce0b6d0f6e0c64da67557780712d10ac6
Fix uninitialized read in doveadm-oldstats

The third argument to doveadm_cmd_param_bool() is only set on a return
value of TRUE.
Since disk_input_field and disk_output_field should be set if the value
of show-disk-io is specified and specified to true, fix the condition.

    doveadm-oldstats.c: In function 'cmd_stats_top':
    doveadm-oldstats.c:551:63: warning: 'b' may be used uninitialized [-Wmaybe-uninitialized]
      551 |         if (!doveadm_cmd_param_bool(cctx, "show-disk-io", &b) && b) {
          |                                                               ^
    doveadm-oldstats.c:545:14: note: 'b' was declared here
      545 |         bool b;
          |              ^

Gbp-Pq: Name Fix-uninitialized-read-in-doveadm-oldstats.patch
src/doveadm/doveadm-oldstats.c