]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virNetDevGetEthtoolGFeatures: Avoid use of VIR_ALLOC_VAR
authorPeter Krempa <pkrempa@redhat.com>
Wed, 3 Feb 2021 12:33:24 +0000 (13:33 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 3 Feb 2021 15:09:25 +0000 (16:09 +0100)
commit52ca0a6229ae56865a09e164737dce703f1690ba
tree3b22ca2f73ff5552006cd0076687ab0d7eb3a1ab
parent729ac1393828c8fa1dfe27df9a71cf0b4e8179f1
virNetDevGetEthtoolGFeatures: Avoid use of VIR_ALLOC_VAR

In this case we need a 'struct ethtool_gfeatures' followed by two
'struct ethtool_get_features_block' so there's no risk of overflow.

Use g_malloc0 and sizeof() to allocate the memory instead of
VIR_ALLOC_VAR.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
src/util/virnetdev.c