mirror of
https://github.com/libvirt/libvirt.git
synced 2026-09-03 20:53:04 -05:00
admin: Add a check to reject negative argument for number of typed params
Since nparams can be technically negative, it is a good practice throughout our code to check if nparams actually has a non-negative value. The same effect would be achieved by converting our internal typed params serializer argument to 'unsigned' type, but it definitely would not be the path of least resistance. Signed-off-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
@@ -838,6 +838,7 @@ virAdmServerSetThreadPoolParameters(virAdmServerPtr srv,
|
||||
|
||||
virCheckAdmServerReturn(srv, -1);
|
||||
virCheckNonNullArgGoto(params, error);
|
||||
virCheckNonNegativeArgGoto(nparams, error);
|
||||
|
||||
if (remoteAdminServerSetThreadPoolParameters(srv, params,
|
||||
nparams, flags) < 0)
|
||||
|
||||
Reference in New Issue
Block a user