提交 77180d0f 编写于 作者: J John Ferlan

tests: Add return value check in checkUserInfo

Commit 1c8113f9 added the call to virTypedParamsGetString without
a return value check which caused Coverity to complain especially
since other checks for the same function are made.

Found by Coverity
Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
上级 11e8d37c
......@@ -1127,7 +1127,9 @@ checkUserInfo(virTypedParameterPtr params,
snprintf(param_name, VIR_TYPED_PARAM_FIELD_LENGTH,
"user.%zu.domain", nth);
virTypedParamsGetString(params, nparams, param_name, &domain);
if (virTypedParamsGetString(params, nparams, param_name, &domain) < 0)
return -1;
if (STRNEQ_NULLABLE(expDomain, domain)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
"Expected domain '%s', got '%s'",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册