From nobody Fri Apr 26 06:07:27 2024 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=1572789240; cv=none; d=zoho.com; s=zohoarc; b=K2pXb5g6e/WZjWTAY3yRhNf2WT+QZocqBlnF0FWbCpREy6ttiXJaTKBnD9191JvdOcerkiNxDL0TOb2w6754Xr9c4HcMGrQzK+jtekdbcks94Po+e9CdzL8nSCwpO8lA1+SKfIgOHXIlzq2fll0rCvEtJc3SPLrq2BrRe8oT+GA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1572789240; 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=l7Ee33hWNiOxSm495QNwtwnQEFtVf4btfeR4iZ8ggv8=; b=UVNLaxng3yUCZK3am6GcGMkeShFVEERSe1Ne68wSsB8fLjsawy/wkbLgU7RMx8YlreYJxR6XlveNdGQqQ9tOyyKvAk9z1UZayhgjRMuQCGeegqe9H5b9tbVbVUJmql/+0ZrOyTTtDdFE850L+1DYH6s+2Mv3E54ylehCCKMaQWc= 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 1572789240927603.2049266408931; Sun, 3 Nov 2019 05:54:00 -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-247-shrx9DRoNQKC-dNCoCobLQ-1; Sun, 03 Nov 2019 08:53:56 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A0E62801FCB; Sun, 3 Nov 2019 13:53:51 +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 4DA086085E; Sun, 3 Nov 2019 13:53:51 +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 A5CBE182B010; Sun, 3 Nov 2019 13:53:45 +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 xA3DripF005784 for ; Sun, 3 Nov 2019 08:53:44 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2F5386085E; Sun, 3 Nov 2019 13:53:44 +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 E582560874 for ; Sun, 3 Nov 2019 13:53:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572789239; 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=l7Ee33hWNiOxSm495QNwtwnQEFtVf4btfeR4iZ8ggv8=; b=aOFu5I5LYL32y/utm/8ehQrXa4ORmpxgP7Y9JrfCBkuc3YBxyk1Em1sU2wq2nVjxp5dhAb LytnA/w0GQ7bxnUyl0Qkg1eVJkunZneiGMGPQJuLWEClO+x3n/th+PZ0JsaUPtcTj64orX klQXAQxKqdDk690YgRxy+uvXiYiVN18= From: John Ferlan To: libvir-list@redhat.com Date: Sun, 3 Nov 2019 08:53:33 -0500 Message-Id: <20191103135340.3505-2-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 1/8] vbox: Fix possible NULL deref 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.79 on 10.5.11.13 X-MC-Unique: shrx9DRoNQKC-dNCoCobLQ-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" The @valueTypeUtf8 references need to use the STREQ_NULLABLE since they're variantly filled in by @valueTypeUtf16. Found by Coverity. Signed-off-by: John Ferlan Reviewed-by: Daniel P. Berrang=C3=A9 --- src/vbox/vbox_common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c index 5486e5ff3b..cdbec15dae 100644 --- a/src/vbox/vbox_common.c +++ b/src/vbox/vbox_common.c @@ -3509,13 +3509,13 @@ vboxDumpDisplay(virDomainDefPtr def, vboxDriverPtr = data, IMachine *machine) VBOX_UTF8_FREE(valueDisplayUtf8); } =20 - if (STREQ(valueTypeUtf8, "sdl")) { + if (STREQ_NULLABLE(valueTypeUtf8, "sdl")) { graphics->type =3D VIR_DOMAIN_GRAPHICS_TYPE_SDL; graphics->data.sdl.display =3D valueDisplayUtf8; valueDisplayUtf8 =3D NULL; } =20 - if (STREQ(valueTypeUtf8, "gui")) { + if (STREQ_NULLABLE(valueTypeUtf8, "gui")) { graphics->type =3D VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP; graphics->data.desktop.display =3D valueDisplayUtf8; valueDisplayUtf8 =3D NULL; --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 06:07:27 2024 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=1572789239; cv=none; d=zoho.com; s=zohoarc; b=kxo/YXPXkerQyFi+em4iPuvlwTIgBqCh5TqpkFU3+l3y+6EQV0yWy3WxRSwWP1q959RmvTmEVRwm9CUXUY7htzPMvZO8qo2dy8pQShbzXs8uHVRybtW39zHotK85lCQSwAYQ4DnF9xhoTiPPKlKuBM/PXCq2hm1IDgLL37SuK2c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1572789239; 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=rdLTaGHyopFlH/uKLgu+mWnckNZlVhY6dC3/xTLWcDI=; b=SB7d4U4X3yiEO7f6IsiK/lQmQWzhGn1wyC3Hm0541Jkme3AXy1elnqOv3zRhTPb8NNCrRkdw6NPA3sizTSDy4dOcg05nJ0Iu8AS3kRoGMoa0Bnp5B0WObgWdbr2na/7Ae0LGLU//ddcZ5/BhB+N8+GrTIMITt4jsrrCm8WalrXc= 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 1572789239874691.4597564867319; Sun, 3 Nov 2019 05:53:59 -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-385-zmvHFpsUPruZI3vohUrYaA-1; Sun, 03 Nov 2019 08:53:56 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 994C81005502; Sun, 3 Nov 2019 13:53:51 +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 496411A8D9; Sun, 3 Nov 2019 13:53:51 +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 BB643182B00F; Sun, 3 Nov 2019 13:53:47 +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 xA3DriRi005789 for ; Sun, 3 Nov 2019 08:53:44 -0500 Received: by smtp.corp.redhat.com (Postfix) id 97F7160874; Sun, 3 Nov 2019 13:53:44 +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 56BE56085E for ; Sun, 3 Nov 2019 13:53:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572789238; 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=rdLTaGHyopFlH/uKLgu+mWnckNZlVhY6dC3/xTLWcDI=; b=TLiiqJ21nhvJ2JdXTrCUpRNvDplJNnonYyGjFXjQuunOsws/YrWn2rVFPuNbkA9XqPNDG/ deI7s/gw3mSq2G8Qp80MsoAxGCxv4Kxak30Usr2ZdEL2ONs4rXn4U3aUwXKmfcfAFynhVu uREgF1NxfWAX0kkgngfqXFZ2SRz0CFo= From: John Ferlan To: libvir-list@redhat.com Date: Sun, 3 Nov 2019 08:53:34 -0500 Message-Id: <20191103135340.3505-3-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 2/8] conf: Remove ATTRIBUTE_NONNULL for virDomainQemuMonitorEventNew 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.23 X-MC-Unique: zmvHFpsUPruZI3vohUrYaA-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 17561eb36 modified the logic to check "if (!event)" for an attribute that was not supposed to be passed as NULL. This causes the static checker/Coverity build to fail. Since the check is made, alter the header. Also add an error message since returning -1 without some sort of error message as previously would have happened with the failed VIR_STRDUP so that the eventual error doesn't get the default for some reason message. Signed-off-by: John Ferlan Reviewed-by: Daniel P. Berrang=C3=A9 --- src/conf/domain_event.c | 6 +++++- src/conf/domain_event.h | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/conf/domain_event.c b/src/conf/domain_event.c index 644f6eb595..900d8f745e 100644 --- a/src/conf/domain_event.c +++ b/src/conf/domain_event.c @@ -1935,8 +1935,12 @@ virDomainQemuMonitorEventNew(int id, return NULL; =20 /* event is mandatory, details are optional */ - if (!event) + if (!event) { + virReportError(VIR_ERR_INVALID_ARG, + _("unexpected event=3DNULL name=3D%s uuid=3D%s deta= ils=3D%s"), + name, uuidstr, NULLSTR(details)); goto error; + } =20 ev->event =3D g_strdup(event); ev->seconds =3D seconds; diff --git a/src/conf/domain_event.h b/src/conf/domain_event.h index d1cfb81d62..0a4bce3d04 100644 --- a/src/conf/domain_event.h +++ b/src/conf/domain_event.h @@ -321,4 +321,4 @@ virDomainQemuMonitorEventNew(int id, long long seconds, unsigned int micros, const char *details) - ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4); + ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 06:07:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.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 205.139.110.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=1572789269; cv=none; d=zoho.com; s=zohoarc; b=R0c7lZYUtou70p89KIrde+xcWSokB61ZTxM2vDg2laAKH5pDNCgKh7XZf3krftwBgdoaNuX++E55gSkbb3oyNYNL80sWRHnGw33GXA3uD1yjnmeZ0ZBYOgjnlp2EN5B7PzrBrjgxG3K42M2eJJXg8aINAt6O7y+ayz7D99jJ3n0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1572789269; 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=0dHd4yQ5O1GQh4drvooir8osk8OH1qlyMIs4z60fJxo=; b=IdEZg/AGfJGRU0Y4dQjZ1tZE+G0h6586+4ZkjCAnrDfuX0NNHkIQEMh3ruLV06LnsHT66cXxI0r9lFBj3vOL/+rHb7ewyCNFhRw6ts2K6KEPMwkapn40w5DkasI/YgTibXOPO9BfEwTm3zBVfaRqVgNFLHy2BI9JIZniqH5StzE= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.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 [205.139.110.120]) by mx.zohomail.com with SMTPS id 1572789269199646.358434157475; Sun, 3 Nov 2019 05:54:29 -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-428-EcvCJTSCM161hpsZ-Tbk6A-1; Sun, 03 Nov 2019 08:54:25 -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 938D9180496F; Sun, 3 Nov 2019 13:54:20 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6D56D1001B34; Sun, 3 Nov 2019 13:54:20 +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 2C4BA4BB78; Sun, 3 Nov 2019 13:54:20 +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 xA3DrjXi005794 for ; Sun, 3 Nov 2019 08:53:45 -0500 Received: by smtp.corp.redhat.com (Postfix) id 08F3F60874; Sun, 3 Nov 2019 13:53:45 +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 BDE456085E for ; Sun, 3 Nov 2019 13:53:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572789268; 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=0dHd4yQ5O1GQh4drvooir8osk8OH1qlyMIs4z60fJxo=; b=c57AExGUKMtpFdXDZL4t96csWs76auFGcLqqImW9xYkcILQJIRohVExSfEsvOQlivIQ+3W QGCDGhtdpe8EIbgCJPlUrjCJT0hVJKgyZgpfxFHBxqeOYo0GgidBPcTgzstOE7Zbsjh8qI Nvg7QRAci6du5HuMg3Lj19weiKCDtaw= From: John Ferlan To: libvir-list@redhat.com Date: Sun, 3 Nov 2019 08:53:35 -0500 Message-Id: <20191103135340.3505-4-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 3/8] tests: Fix memory leak in mymain 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: EcvCJTSCM161hpsZ-Tbk6A-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 944a35d7f0 added @fakerootdir; however, there are multiple paths out of mymain that didn't free the memory - so just use the g_autofree to resolve the potential leak. Found by Coverity Signed-off-by: John Ferlan Reviewed-by: Daniel P. Berrang=C3=A9 --- tests/qemuhotplugtest.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 4ff2b38c83..ebf4582ac1 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -595,7 +595,7 @@ mymain(void) int ret =3D 0; struct qemuHotplugTestData data =3D {0}; struct testQemuHotplugCpuParams cpudata; - char *fakerootdir; + g_autofree char *fakerootdir =3D NULL; =20 fakerootdir =3D g_strdup(FAKEROOTDIRTEMPLATE); =20 @@ -875,7 +875,6 @@ mymain(void) =20 if (getenv("LIBVIRT_SKIP_CLEANUP") =3D=3D NULL) virFileDeleteTree(fakerootdir); - VIR_FREE(fakerootdir); =20 qemuTestDriverFree(&driver); virObjectUnref(data.vm); --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 06:07:27 2024 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=1572789269; cv=none; d=zoho.com; s=zohoarc; b=EcM/6SWLeBa0sCqsvi2ByoTzirWjnjvPpFXBNx8Ng1Qp6isJihtLqKOZIsoIuxqvggdfUs6BNeCxBRmmiBAXJg67inRDeIXiFYbLso1X/xqv/FEnr9/DHgGqCgrJEDo8hNlmMckirVPpgLQmU2P+9XVgMt2uw/UgHbxCOcOOKPA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1572789269; 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=l066elW1rp6JgyDALq/7pjdGZKmtFvatjS+4cInLicI=; b=OD9I9vf/rUMtp9Z3PejhFZKnz6w/CtJvDU2W+mqwZIuBAEb6udM5q7C6zaGDFeCVX0o7UJ+rInPDH/DZgjrz5+g/vISxslWkOmil0EYrbIeNJS4+haCuEGEduk/Ydv5iJ42e3k4+zW60lXmfzfEv2psDATGbyBuEsSYMIFFed8I= 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 1572789269155826.4090791611694; Sun, 3 Nov 2019 05:54:29 -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-19-IlBOaZDOMB63ifIf9dzW9w-1; Sun, 03 Nov 2019 08:54:26 -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 4E48A107ACC5; Sun, 3 Nov 2019 13:54:21 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 201EF1001B23; Sun, 3 Nov 2019 13:54:21 +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 C461B4E566; Sun, 3 Nov 2019 13:54:20 +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 xA3DrjQJ005800 for ; Sun, 3 Nov 2019 08:53:45 -0500 Received: by smtp.corp.redhat.com (Postfix) id 72BE460874; Sun, 3 Nov 2019 13:53:45 +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 329356085E for ; Sun, 3 Nov 2019 13:53:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572789268; 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=l066elW1rp6JgyDALq/7pjdGZKmtFvatjS+4cInLicI=; b=JVH2zQkgWaKaCtD/zwl/nSD46wFTZFUjpcvvb7qCgOlSyyE0OpZcdfI4Hx/R1IKGZMJLRb ySVo6/+6VxUYvuGwwmcn7DgizDNu7xtnOX4oxKEIFBXd5t275L36k2DgAkiSGlqgwW21ND CbbkcN4jWIA8tt/l6ErRO4hq7R6/Kj8= From: John Ferlan To: libvir-list@redhat.com Date: Sun, 3 Nov 2019 08:53:36 -0500 Message-Id: <20191103135340.3505-5-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 4/8] lxc: Remove unnecessary comment 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: IlBOaZDOMB63ifIf9dzW9w-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 66e2adb2ba moved the code and the coverity comment which now was useless since the context was in lxcContainerSetupPivotRoot. Signed-off-by: John Ferlan Reviewed-by: Daniel P. Berrang=C3=A9 --- src/lxc/lxc_container.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c index a18b214a25..1fb9049c96 100644 --- a/src/lxc/lxc_container.c +++ b/src/lxc/lxc_container.c @@ -1658,11 +1658,6 @@ static int lxcContainerUnmountForSharedRoot(const ch= ar *stateDir, /* Some versions of Linux kernel don't let you overmount * the selinux filesystem, so make sure we kill it first */ - /* Filed coverity bug for false positive 'USE_AFTER_FREE' due to swap - * of root->src with root->dst and the VIR_FREE(root->src) prior to the - * reset of root->src in lxcContainerPrepareRoot() - */ - /* coverity[deref_arg] */ if (lxcContainerUnmountSubtree(SELINUX_MOUNT, false) < 0) goto cleanup; #endif --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 06:07:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.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 205.139.110.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=1572789268; cv=none; d=zoho.com; s=zohoarc; b=mX691x1mpCrHFU8ByRFKxlENVKPMl2vf60oCHSqz61LzH3qqkojuYqvzJSJdD8nloGB5B8vMEk62m3Vp8smmwCJvbrB5hn/pY7V6d1mGeew+C0IlxEH4BHrYwDiZ2nsM3G0LVYjeQZ+CrUYqzijkkjiJ9PxH7M+rEC8HGnZ8FY4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1572789268; 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=DAPfkw9y9t6WSukk6gcSyEst/GnebKsguD71UFlo7yY=; b=Z+wkW+pV9gKl6z1qFNgIobhEQ+dD7KZkvfoH3gYR+oub9tr0+FJliXU/LKiQ5CMWlx7/vijbY6gIYqxg7cKsduuWrQTt5x8wQ0g2n/R9Eo/S9QR2bUzJiDqLmeYA7sAOgOxoomjyfSf/6ChqglOdCQH2Zhsj8lzDBeVkXjKtavU= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.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 [205.139.110.120]) by mx.zohomail.com with SMTPS id 1572789268677205.81257650311636; Sun, 3 Nov 2019 05:54:28 -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-8-VPfQpCL9OEuOUoSkbQNnIw-1; Sun, 03 Nov 2019 08:54:25 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C5DBD801E68; Sun, 3 Nov 2019 13:54:20 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9883B6085E; Sun, 3 Nov 2019 13:54:20 +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 3115A4A460; Sun, 3 Nov 2019 13:54:20 +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 xA3DrjnT005810 for ; Sun, 3 Nov 2019 08:53:45 -0500 Received: by smtp.corp.redhat.com (Postfix) id DE2F360874; Sun, 3 Nov 2019 13:53:45 +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 9ECCF6085E for ; Sun, 3 Nov 2019 13:53:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572789267; 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=DAPfkw9y9t6WSukk6gcSyEst/GnebKsguD71UFlo7yY=; b=hyA+2Tf5M653CmddbX309rxAmwKnUKLrQxciP4b28LlF0+nlSi/vmIaKkcIcU+ve2my+Gk lYBcl1l1MZVOYmrFtotJ95GTzAxbLmbcVcXEV70WIV7+/vcfZ9iCY7sFDGtsOaZK88YYl5 b6FvL3IGbvZjrfqW7iHWD0NXgXH7oI4= From: John Ferlan To: libvir-list@redhat.com Date: Sun, 3 Nov 2019 08:53:37 -0500 Message-Id: <20191103135340.3505-6-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 5/8] tests: Remove _NULLABLE in virNetDevExists mock 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.79 on 10.5.11.13 X-MC-Unique: VPfQpCL9OEuOUoSkbQNnIw-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" The @ifname is listed as an ATTRIBUTE_NONNULL(1) parameter, so checking for _NULLABLE causes a coverity build failure - remove that and if it's NULL for the test let's fail miserably. Signed-off-by: John Ferlan Reviewed-by: Daniel P. Berrang=C3=A9 --- tests/qemuxml2argvmock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemuxml2argvmock.c b/tests/qemuxml2argvmock.c index 914d2bcf9f..8143de1618 100644 --- a/tests/qemuxml2argvmock.c +++ b/tests/qemuxml2argvmock.c @@ -169,7 +169,7 @@ virNetDevSetMAC(const char *ifname G_GNUC_UNUSED, int virNetDevExists(const char *ifname) { - return STREQ_NULLABLE(ifname, "mytap0"); + return STREQ(ifname, "mytap0"); } =20 =20 --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 06:07:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.81 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=1572789313; cv=none; d=zoho.com; s=zohoarc; b=bY8KtqZlAkZCjrPnnnAkyVxPt4Nh5xHtNbaSIUHmwFRAQmP8tgApc7pG438VnVGam71rVtkYsll4vCumqaTm6jfgdsvXRx6dPYgbgkJP7yHbUaw8gplMrFFcC+BifhgrMcK1LN5i0oec4Fp6UhEgODFglsU03xo6x/XbvXT2F9U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1572789313; 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=RlbLchA1u99abz5/3awlCyMtr1EZn+MvBe0tXaSB9Hw=; b=kMwKkKRoTIySJKdebKzGEI1BkTbNsF/KNjASoIFM/p0kk+vTFNr+lfMJbPzdHUri6akLAoyTuthRFGlIPC6AnFslLy2pg13xH8QanCY0Jjuq9qILnvA+GHDiXl88RWBUBP3Tn/VIESoWsW62iIPlolJ+EY2qV34vOW9kbBRncMw= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.81 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-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 157278931387327.479951986686387; Sun, 3 Nov 2019 05:55:13 -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-45-64di2V9aPnaLMxieZgrWfg-1; Sun, 03 Nov 2019 08:54:31 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 09A27801E6B; Sun, 3 Nov 2019 13:54:24 +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 D923260C88; Sun, 3 Nov 2019 13:54:23 +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 992A7182B012; Sun, 3 Nov 2019 13:54:23 +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 xA3Drk7n005818 for ; Sun, 3 Nov 2019 08:53:46 -0500 Received: by smtp.corp.redhat.com (Postfix) id 56EF260874; 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 146C66085E for ; Sun, 3 Nov 2019 13:53:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572789312; 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=RlbLchA1u99abz5/3awlCyMtr1EZn+MvBe0tXaSB9Hw=; b=iwArnIiVCt044BVdAfn1OlBlAIXNB2bo1H6zjr3IGAjAvqnM9dWEi/SgXtPZUHiaSDp7q3 4FDlBzwec3F9tOKeIyq0YzzsJVOwxQWPD1g20wWMCJh/M5tfms9XvlHoA4JtlMSPrZLWPg pNw5GWqFOmHASx527NlhSdImmb1WaXo= From: John Ferlan To: libvir-list@redhat.com Date: Sun, 3 Nov 2019 08:53:38 -0500 Message-Id: <20191103135340.3505-7-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 6/8] qemu: Fix possible NULL deref in qemuDomainSaveImageStartVM 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.79 on 10.5.11.12 X-MC-Unique: 64di2V9aPnaLMxieZgrWfg-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 075523438 added a direct reference to @cookie even though it may be NULL as shown by a comment a few lines previous - so add the check here as well. Found by Coverity Signed-off-by: John Ferlan Reviewed-by: Daniel P. Berrang=C3=A9 --- src/qemu/qemu_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index d17c18705b..56fcba8b2c 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -6831,7 +6831,7 @@ qemuDomainSaveImageStartVM(virConnectPtr conn, qemuDomainFixupCPUs(vm, &cookie->cpu) < 0) goto cleanup; =20 - if (!cookie->slirpHelper) + if (cookie && !cookie->slirpHelper) priv->disableSlirp =3D true; =20 if (qemuProcessStart(conn, driver, vm, cookie ? cookie->cpu : NULL, --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 06:07:27 2024 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 Reviewed-by: Daniel P. Berrang=C3=A9 --- 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 From nobody Fri Apr 26 06:07:27 2024 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=1572789429; cv=none; d=zoho.com; s=zohoarc; b=on6R8VP2n2rGHSDwtEhJIDI883H7zDO5DOMUCd7GSyDNYZYZ0YZWPNU86PL6Ceos1Tb2hRd6o9eiwK1ledWd+3VwyO2XpoTMGJm2uBZwosbjmCB8ABo3GKxbBAfVRFy9hsKBH/QN12IDUi+kEecsd0di2lhZ4Kh1p7qlpCQoEi8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1572789429; 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=UoknNEpO8E1Y2lfeiPRItaIvvCX7V2TV7yU0f4NLuKw=; b=dfh0rKjSqsZFEqVKwPHJK3RrX6uy2SDodO+VcwsiBLo7V8owBtuWKOj5UOIfioKtP9+pyqjWID2i2v9wZcQS/YwkBHsMDk5r6r4D48Rmuq0QU3mHQ6Du1UKJ8YEmGuLzFdc9KL3gZIQutjK8K1M1N3pBv5VF/DaugnulrsmyXKU= 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 1572789429526733.2320985735219; Sun, 3 Nov 2019 05:57:09 -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-225-XD6iOkdKP1W44e3me5UrnQ-1; Sun, 03 Nov 2019 08:54:35 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5F78C47A; Sun, 3 Nov 2019 13:54:30 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3B2C4600D3; Sun, 3 Nov 2019 13:54:30 +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 F3B014E56D; Sun, 3 Nov 2019 13:54:29 +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 xA3DrlDZ005830 for ; Sun, 3 Nov 2019 08:53:47 -0500 Received: by smtp.corp.redhat.com (Postfix) id 3AF2860874; Sun, 3 Nov 2019 13:53:47 +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 E477C6085E 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=1572789428; 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=UoknNEpO8E1Y2lfeiPRItaIvvCX7V2TV7yU0f4NLuKw=; b=WBqWMwqTLoOZNCrqzv+hrEijygalaCeXWJfsCW+gJADy/yXga+M99U6QWXf3S2tOY/6AUZ +vGd4R+LXK/fCwGfZx/A3eH/thcKoU7cBAh1isgT0HbblS1sA1nVCZ0LFlBIkit3OHVXwz UWlabUJOLI+BMt5qGdhWU5JK3kFQmLA= From: John Ferlan To: libvir-list@redhat.com Date: Sun, 3 Nov 2019 08:53:40 -0500 Message-Id: <20191103135340.3505-9-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 8/8] tests: Fix logic to not have possible NULL deref 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.79 on 10.5.11.11 X-MC-Unique: XD6iOkdKP1W44e3me5UrnQ-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" It's possible that virBitmapNewString returns NULL with an error string (and not an allocation failure that would abort); however, if virBitmapToString is called with a NULL @bitmap, then it will fail in an ugly manner. So rather than have if (!map && !str) logic, split the checks for each variable. Found by Coverity Signed-off-by: John Ferlan Reviewed-by: Daniel P. Berrang=C3=A9 --- tests/virbitmaptest.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/virbitmaptest.c b/tests/virbitmaptest.c index 545e9272df..2808d9c880 100644 --- a/tests/virbitmaptest.c +++ b/tests/virbitmaptest.c @@ -682,9 +682,11 @@ test13(const void *opaque G_GNUC_UNUSED) =20 for (i =3D 0; i < G_N_ELEMENTS(strings); i++) { map =3D virBitmapNewString(strings[i]); - str =3D virBitmapToString(map, false, true); + if (!map) + goto cleanup; =20 - if (!map || !str) + str =3D virBitmapToString(map, false, true); + if (!str) goto cleanup; =20 if (STRNEQ(strings[i], str)) { --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list