From 77180d0f703c60ea511a695c12a4f49f186531e2 Mon Sep 17 00:00:00 2001 From: John Ferlan Date: Sun, 3 Nov 2019 07:39:22 -0500 Subject: [PATCH] tests: Add return value check in checkUserInfo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit 1c8113f9c 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: John Ferlan Reviewed-by: Daniel P. Berrangé --- tests/qemuagenttest.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/qemuagenttest.c b/tests/qemuagenttest.c index cef9ae5fee..ae55086d17 100644 --- a/tests/qemuagenttest.c +++ b/tests/qemuagenttest.c @@ -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'", -- GitLab