Fix uninitialized read in doveadm-oldstats
authorChristian Göttsche <cgzones@googlemail.com>
Sat, 23 Jul 2022 14:38:23 +0000 (16:38 +0200)
committerPeter Michael Green <plugwash@raspbian.org>
Thu, 20 Jun 2024 17:16:27 +0000 (17:16 +0000)
commitc87be8d2c3ff9d41b5d30b53972b8a8ff9458b54
tree0b00c605523f89db1396d7ef97a6f4969a852ef7
parentd69cbd6fd370e41e9f646fa3d60048efaddc5f3c
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