On a Tuesday in 2024, Daniel P. Berrangé wrote:
The typed parameter array must be either 0, or a positive
number.
Does this matter?
The API documentation says:
* @nparams: pointer to received number of interface parameter
and it looks like we ignore the number as long as params is NULL.
Jano
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
_______________________________________________
Devel mailing list -- devel(a)lists.libvirt.org
To unsubscribe send an email to devel-leave(a)lists.libvirt.org