From nobody Sun Feb 8 07:52:45 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1564671672; cv=none; d=zoho.com; s=zohoarc; b=dkuE5X9eQP650qDf1gKaCn/4Xe0X79aW6oGxOJIc9pcYZ4hrH/c43bzG497r5mIUTYheD8Pv5q2aQcxVcSJwkD8qQQE/fHBwx2JbS4NGDEbEQ+XH+Q+u7cNkMqns+m02bPvhVDiD7K8xpmzcP1UkoMs1+ZYijKyhTBD0xLVMQnQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564671672; 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:ARC-Authentication-Results; bh=cUtJ1zU92yciyInqi/M7Unzdh/nK8ftWnbD7XSuTcck=; b=Lr6dVQp7byYd4EwwRgnY4r/Q1VLyS1czlITy18ei0c6At1zB/aYkWGYjLUEER8SP3ZTLFodNF96ClA4oLxQfZboGPfZu9cTCWfxl1Vtw1Rwvv0zSOtr12oftfQYOi8b4t5xd3Q/k7uErp89LAFJBe1lEMNKmxztB6TSAts0S6Dk= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1564671672444869.8611923643041; Thu, 1 Aug 2019 08:01:12 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 162BAB2DCD; Thu, 1 Aug 2019 15:01:09 +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 C488F614DD; Thu, 1 Aug 2019 15:01:08 +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 7823D180B536; Thu, 1 Aug 2019 15:01:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x71F0n9o032095 for ; Thu, 1 Aug 2019 11:00:49 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1F16F19693; Thu, 1 Aug 2019 15:00:49 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (dhcp-94.gsslab.fab.redhat.com [10.33.9.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id 80A77196FE; Thu, 1 Aug 2019 15:00:48 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Thu, 1 Aug 2019 16:00:03 +0100 Message-Id: <20190801150019.10519-2-berrange@redhat.com> In-Reply-To: <20190801150019.10519-1-berrange@redhat.com> References: <20190801150019.10519-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 01/17] tools: fix crash in virt-login-shell if config doesn't exist 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 01 Aug 2019 15:01:11 +0000 (UTC) If the 'allowed_users' config setting in virt-login-shell.conf does not exist, we dereference a NULL pointer resulting in a crash. We should check for this case and thus ensure the user is denied access gracefully. Signed-off-by: Daniel P. Berrang=C3=A9 --- tools/virt-login-shell.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/virt-login-shell.c b/tools/virt-login-shell.c index ee5c04f9c2..b906fa9ed6 100644 --- a/tools/virt-login-shell.c +++ b/tools/virt-login-shell.c @@ -54,7 +54,7 @@ static int virLoginShellAllowedUser(virConfPtr conf, goto cleanup; =20 =20 - for (entries =3D users; *entries; entries++) { + for (entries =3D users; entries && *entries; entries++) { char *entry =3D *entries; /* If string begins with a % this indicates a linux group. --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list