diff options
| author | Michael Brown | 2022-02-16 14:22:56 +0100 |
|---|---|---|
| committer | Michael Brown | 2022-02-16 14:29:53 +0100 |
| commit | 252cff5e9a0b67a27e1837cb674491692b717fd0 (patch) | |
| tree | b90f91d3902e223e108bde1232ff01e036cfbb08 /src/net | |
| parent | [pci] Ensure that pci_read_config() initialises all fields (diff) | |
| download | ipxe-252cff5e9a0b67a27e1837cb674491692b717fd0.tar.gz ipxe-252cff5e9a0b67a27e1837cb674491692b717fd0.tar.xz ipxe-252cff5e9a0b67a27e1837cb674491692b717fd0.zip | |
[xsigo] Avoid storing unused uninitialised fields in gateway address
As reported by Coverity, xsmp_rx_xve_modify() currently passes a
partially initialised struct ib_address_vector to xve_update_tca() and
thence to eoib_set_gateway(), which uses memcpy() to store the whole
structure including the (unused and unneeded) uninitialised fields.
Silence the Coverity warning by zeroing the whole structure.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/net')
| -rw-r--r-- | src/net/infiniband/xsigo.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/net/infiniband/xsigo.c b/src/net/infiniband/xsigo.c index 0ee753c38..4f5c618d7 100644 --- a/src/net/infiniband/xsigo.c +++ b/src/net/infiniband/xsigo.c @@ -870,6 +870,7 @@ static int xsmp_rx_xve_modify ( struct xsigo_manager *xcm, * erroneously transmitted as little-endian. */ mtu = ntohs ( msg->mtu ); + memset ( &tca, 0, sizeof ( tca ) ); tca.qpn = ntohl ( msg->tca.data ); tca.qkey = ntohs ( msg->tca.qkey ); tca.gid_present = 1; |
