From: Andrey Shinkevich Date: Tue, 30 Jul 2019 16:01:36 +0000 (+0300) Subject: test-throttle: Fix uninitialized use of burst_length X-Git-Tag: v4.2.0-rc0~224^2~23 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ef0aa6af47da16f5367f545deb599a14ea408bee;p=thirdparty%2Fqemu.git 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: Andrey Shinkevich Message-Id: <1564502498-805893-2-git-send-email-andrey.shinkevich@virtuozzo.com> Signed-off-by: Paolo Bonzini --- diff --git a/tests/test-throttle.c b/tests/test-throttle.c index 083e1f9ba86..7adb5e6652c 100644 --- a/tests/test-throttle.c +++ b/tests/test-throttle.c @@ -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;