From nobody Sat Feb 7 08:44:14 2026 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 --- 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