]> xenbits.xensource.com Git - libvirt.git/commit
remote: Initialize args variable
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 26 Jan 2023 12:19:31 +0000 (13:19 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 26 Jan 2023 14:05:50 +0000 (15:05 +0100)
commit0211e430a87a96db9a4e085e12f33caad9167653
tree1fc08cdb302cc7fb0b5db2b2f1898ab47f049dbd
parentc3afde9211b550d3900edc5386ab121f5b39fd3e
remote: Initialize args variable

Recently, in v9.0.0-7-gb2034bb04c we've dropped initialization of
@args variable. The reasoning was that eventually, all members of
the variable will be set. Well, this is not correct. For
instance, in remoteConnectGetAllDomainStats() the
args.doms.doms_val pointer is set iff @ndoms != 0. However,
regardless of that, the pointer is then passed to VIR_FREE().

Worse, the whole args is passed to
xdr_remote_connect_get_all_domain_stats_args() which then calls
xdr_array, which tests the (uninitialized) pointer against NULL.

This effectively reverts b2034bb04c61c75ddbfbed46879d641b6f8ca8dc.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
src/remote/remote_driver.c