tests/qtest: Fix potential NULL pointer dereference in qos_build_main_args()
commitc59c582d56ee3bbde15e6788c0d28329792b2573
authorAlexChen <alex.chen@huawei.com>
Tue, 3 Nov 2020 14:53:09 +0000 (3 22:53 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 3 Nov 2020 15:15:43 +0000 (3 10:15 -0500)
treeb07de13589b876742a213c93aa1415ec7a1ac5fb
parent3569a5dfc11f2c4880b7cddd9e0091b29aa0e015
tests/qtest: Fix potential NULL pointer dereference in qos_build_main_args()

In qos_build_main_args(), the pointer 'path' is dereferenced before
checking it is valid, which may lead to NULL pointer dereference.
So move the assignment to 'cmd_line' after checking 'path' is valid.

Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Alex Chen <alex.chen@huawei.com>
Message-Id: <5FA16ED5.4000203@huawei.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tests/qtest/fuzz/qos_fuzz.c