提交 ca0d4514 编写于 作者: E Erik Skultety

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: NErik Skultety <eskultet@redhat.com>
上级 71714e85
......@@ -838,6 +838,7 @@ virAdmServerSetThreadPoolParameters(virAdmServerPtr srv,
virCheckAdmServerReturn(srv, -1);
virCheckNonNullArgGoto(params, error);
virCheckNonNegativeArgGoto(nparams, error);
if (remoteAdminServerSetThreadPoolParameters(srv, params,
nparams, flags) < 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册