Commit ef0aa6af authored by Andrey Shinkevich's avatar Andrey Shinkevich Committed by Paolo Bonzini
Browse files

test-throttle: Fix uninitialized use of burst_length



ThrottleState::cfg of the static variable 'ts' is reassigned with the
local one in the do_test_accounting() and then is passed to the
throttle_account() with uninitialized member LeakyBucket::burst_length.

Signed-off-by: default avatarAndrey Shinkevich <andrey.shinkevich@virtuozzo.com>
Message-Id: <1564502498-805893-2-git-send-email-andrey.shinkevich@virtuozzo.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent de428cea
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -558,6 +558,8 @@ static bool do_test_accounting(bool is_ops, /* are we testing bps or ops */
    BucketType index;
    int i;

    throttle_config_init(&cfg);

    for (i = 0; i < 3; i++) {
        BucketType index = to_test[is_ops][i];
        cfg.buckets[index].avg = avg;