mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
network: ensure nparams is non-NULL and non-negative
The typed parameter array length must be non-NULL and either 0, or a positive number. Reviewed-by: Ján Tomko <jtomko@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
ded74b3369
commit
e5b7f1e266
@ -1577,6 +1577,9 @@ virNetworkPortGetParameters(virNetworkPortPtr port,
|
|||||||
virCheckNetworkPortReturn(port, -1);
|
virCheckNetworkPortReturn(port, -1);
|
||||||
conn = port->net->conn;
|
conn = port->net->conn;
|
||||||
|
|
||||||
|
virCheckNonNullArgGoto(nparams, error);
|
||||||
|
virCheckNonNegativeArgGoto(*nparams, error);
|
||||||
|
|
||||||
if (conn->networkDriver && conn->networkDriver->networkPortGetParameters) {
|
if (conn->networkDriver && conn->networkDriver->networkPortGetParameters) {
|
||||||
int ret;
|
int ret;
|
||||||
ret = conn->networkDriver->networkPortGetParameters(port, params, nparams, flags);
|
ret = conn->networkDriver->networkPortGetParameters(port, params, nparams, flags);
|
||||||
|
Loading…
Reference in New Issue
Block a user