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>
Sun, 10 Mar 2024 06:31:22 +0000 (22:31 -0800)
commitde663d9f323328cb6dab238a6f0f6dc57c0e5d1b
tree3f9c43487a95dbcb5b665eef6368d995f19fc0b5
parent02eeb110699b0b9f15a286859456db3912b452b9
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