The typed parameter array must be either 0, or a positive
number.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/libvirt-network.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/libvirt-network.c b/src/libvirt-network.c
index ef17a8a04d..e467716b6a 100644
--- a/src/libvirt-network.c
+++ b/src/libvirt-network.c
@@ -1577,6 +1577,8 @@ virNetworkPortGetParameters(virNetworkPortPtr port,
virCheckNetworkPortReturn(port, -1);
conn = port->net->conn;
+ virCheckNonNegativeArgGoto(*nparams, error);
+
if (conn->networkDriver &&
conn->networkDriver->networkPortGetParameters) {
int ret;
ret = conn->networkDriver->networkPortGetParameters(port, params, nparams,
flags);
--
2.43.0