From nobody Sat Feb 7 08:44:12 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1572789325; cv=none; d=zoho.com; s=zohoarc; b=BqliEMWlqQw3D1RGZWkIZMq0IEuTyetwccdUadtqAsJR5eW1mAAs3JgSBA3/1P8Nh789LWls5ZCViEtQLaYdAm2c0cpPxwsTut5OetlglyXVTiLuetcy2YtKCBR/WazTgK+vW9TlZSLCH+646KrJD8cxYqDRaEd/CJOivzntY/0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1572789325; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7JhdTcW4Eb+NU42FGElYWDY8QSx42hIAni6fh2Xfl1s=; b=Jc84ne83pRh9ebtezGEW3oJ8GRX5mOi3fu9sP++6nfclxJoMqFbiJlLS1ZOnSCJCw93plK0Hjtu9ZV5VDCwuBDPKX58fbc2PB7t27hsXadn1WcyPUrO15ft085hiVNLV5auS/d/0rj8VQ8f9PxnWGiaHW11rdN4CMLw7W0JM1YE= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 157278932592492.18995748324414; Sun, 3 Nov 2019 05:55:25 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-30-YPLslELqPHm6QgAOuZbVyQ-1; Sun, 03 Nov 2019 08:54:34 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 533F32EE4; Sun, 3 Nov 2019 13:54:27 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2C8FD1001B2D; Sun, 3 Nov 2019 13:54:27 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id EA81F182B017; Sun, 3 Nov 2019 13:54:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xA3DrkNR005825 for ; Sun, 3 Nov 2019 08:53:46 -0500 Received: by smtp.corp.redhat.com (Postfix) id BD07F60874; Sun, 3 Nov 2019 13:53:46 +0000 (UTC) Received: from unknown04D3B0C4CC7D.redhat.com (ovpn-116-59.phx2.redhat.com [10.3.116.59]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7D9EB6085E for ; Sun, 3 Nov 2019 13:53:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572789325; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=7JhdTcW4Eb+NU42FGElYWDY8QSx42hIAni6fh2Xfl1s=; b=cxBzSvrYLKqRhFyBC+UHfJOQjsPMbv67h8K13PI/D3L46cfuG6HEECD9Xj6gpyitSlFg8r hnEdM8mYgLe1ENTwQk397fMGzohWHcRpXbwZ0J+IyljzNyU2THwM7XwYK++j6V/4fa3ZP3 JGOwn2/d/JABr/TWxnMNttF+UECpjXQ= From: John Ferlan To: libvir-list@redhat.com Date: Sun, 3 Nov 2019 08:53:39 -0500 Message-Id: <20191103135340.3505-8-jferlan@redhat.com> In-Reply-To: <20191103135340.3505-1-jferlan@redhat.com> References: <20191103135340.3505-1-jferlan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 7/8] tests: Add return value check in checkUserInfo X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: YPLslELqPHm6QgAOuZbVyQ-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" 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 --- 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, =20 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'", --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list