From nobody Sat May 11 21:19:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1652947238; cv=none; d=zohomail.com; s=zohoarc; b=R8dGNG3m8HZMiWGrxvbll7KXGJgiSnIAI9/MBDi+bHGAhm30opngliZus6NwJyIdYco2CSfVZwLfbwVIjui7AjKBteebnjFi8E8kASRibAbUUp1W6UcyVxJDAKMpSBAzTyNRvpQEa63C5xl/TqllHoYRkp7l1wajgxDK2UqHPvU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652947238; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=SUkw1Gc/mbkedBUllOP24rRS9uDQhi0hVdyTD/GUS34=; b=jYbOt2Uvs3My6EgEeT72LvTBic10s8kIjtQP2umidHU930WB67noL7LRb/3RN+8euaDIvPpdNohCZw7iy3Q5tRs3X+4VbvbITeeZFSQVsvjXlFUZuHLdRBDBRBpdJ/ssJcpk8fVWD6e2rdYY2FWrNZno6IRpvCQpSxnb00/brVc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1652947238505348.72610311239; Thu, 19 May 2022 01:00:38 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-572-8Ek9g59qMHCL0OloZzb1EA-1; Thu, 19 May 2022 04:00:34 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CE65380A0B9; Thu, 19 May 2022 08:00:30 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2F9757ADD; Thu, 19 May 2022 08:00:29 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id F1E871947B91; Thu, 19 May 2022 08:00:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id EC83F1949759 for ; Thu, 19 May 2022 08:00:27 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id E0BC1400DFB5; Thu, 19 May 2022 08:00:27 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id 886F740CF8F5 for ; Thu, 19 May 2022 08:00:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652947237; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=SUkw1Gc/mbkedBUllOP24rRS9uDQhi0hVdyTD/GUS34=; b=DMIPrLjFHgE4DYr3qVDoCBENfYIPaaboRt3RPpmQvJ8gs7KV7Rb3Pg8kAmjsTc2Rgcky/T jApADOVp5iWMCsCV51lmSlZIxqeAcham/Dd+lB+2Vi/aM/SIgZ6DNxQ+BqkiPZLhHq0GB0 MzDjJVP3X759FwFMmt2mvoRugC8izUo= X-MC-Unique: 8Ek9g59qMHCL0OloZzb1EA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH] remoteOpenConn: Pass correct variable to virConnectSetIdentity() Date: Thu, 19 May 2022 10:00:26 +0200 Message-Id: <87581c914745444ea2f6499063b5d088e3a4ce24.1652947218.git.mprivozn@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1652947240050100001 Content-Type: text/plain; charset="utf-8"; x-default="true" The remoteOpenConn() function was refactored recently. As a part of that new variable @newconn was introduced which holds virConnect object as it's being gradually constructed throughout the function. At the very end, when everything succeeded the variable is stolen into passed @conn. However, there was one line missed in the refactor which still access the @conn instead of @newconn leading to a NULL dereference. Fixes: f7c422993e4c7ca3e58b1d0d69f4772851af399f Signed-off-by: Michal Privoznik Reviewed-by: Erik Skultety --- src/remote/remote_daemon_dispatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/remote/remote_daemon_dispatch.c b/src/remote/remote_daemon= _dispatch.c index c1f85925a3..0fde4233a5 100644 --- a/src/remote/remote_daemon_dispatch.c +++ b/src/remote/remote_daemon_dispatch.c @@ -1829,7 +1829,7 @@ remoteOpenConn(const char *uri, VIR_DEBUG("Opened driver %p", newconn); =20 if (preserveIdentity) { - if (virConnectSetIdentity(*conn, identparams->par, identparams->np= ar, 0) < 0) + if (virConnectSetIdentity(newconn, identparams->par, identparams->= npar, 0) < 0) return -1; =20 VIR_DEBUG("Forwarded current identity to secondary driver"); --=20 2.35.1