From nobody Mon Feb 9 10:51:45 2026 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=1654504013; cv=none; d=zohomail.com; s=zohoarc; b=CNx9c3jFVqIryV5sQEy7I6tTg+BMSgHvwLveXToEZjVXe9jvCHppQDl/0Co5ZXOH/iZQxGmTal/MjjbDuZFgFMPpJcoQ9jL/y7SsufCet1J9qB7QNIJXLElbedPLXYeAOCAiZH8Mcrx2HJdcz9+mPtBxLiVeXxEAp9vgAtVHyfY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1654504013; 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=cAo5IOKEk38JYUN3uZ7tQQVfm97qTZT1w51iEoSimyM=; b=Ie0Y3WdS/+4dhmC0H0DQyUF9h8+vapgoqfjFiJCBLgN8fQAl3ibZhb+I2eMHZULPsB6epj7LfQPQjjbIhcVVY/QED0q0L3o/5RUkYw7X8QUMZeickX86g9B+uhRTeRrskIO92H49KCfDvK5mlIa4MtDAkkDej81RJxikSUMFslM= 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 165450401376074.43227117672211; Mon, 6 Jun 2022 01:26:53 -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-654-whRfFIMgP7ejRoUbb0Ahkw-1; Mon, 06 Jun 2022 04:26:49 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7FCB1811E75; Mon, 6 Jun 2022 08:26:47 +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 C91D31415100; Mon, 6 Jun 2022 08:26:46 +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 560131947079; Mon, 6 Jun 2022 08:26:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id F21E7194706E for ; Mon, 6 Jun 2022 08:26:39 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id D428F9D7F; Mon, 6 Jun 2022 08:26:39 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 59F5382890 for ; Mon, 6 Jun 2022 08:26:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654504012; 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=cAo5IOKEk38JYUN3uZ7tQQVfm97qTZT1w51iEoSimyM=; b=Kk5MRxLZmh95M9oaXLE6qdyj6B+mDcrxoiDyQ/kdhXSDI/r/PrRsKTc08csffomaTWs53K ftaP0sjArRM01kUO2itn+BG47mnDuLhRPgtcg5vXVIkLS6kLGXABLm0lVGdSCrMLyh3OTP wXe18GLM0kVVkcDwxZei3Wl4sxVFapw= X-MC-Unique: whRfFIMgP7ejRoUbb0Ahkw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH] qemu: Fix crash in qemuBuildDeviceCommandlineHandleOverrides Date: Mon, 6 Jun 2022 10:26:38 +0200 Message-Id: <4d2e524d9a70f8cdb7cea1d2275b49059f1a5215.1654503998.git.pkrempa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 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.85 on 10.11.54.7 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: 1654504015225100001 Content-Type: text/plain; charset="utf-8" 'STREQ' is used to compare the override alias with the device alias. While the parser ensures that the override alias is non-NULL, the device alias may be NULL and STREQ doesn't handle that. Fixes: 38ab5c9ead5 Resolves: https://gitlab.com/libvirt/libvirt/-/issues/321 Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko Reviewed-by: Pavel Hrdina --- src/qemu/qemu_command.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 52e4ef03cd..b1be77743c 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -240,6 +240,10 @@ qemuBuildDeviceCommandlineHandleOverrides(virJSONValue= *props, const char *alias =3D virJSONValueObjectGetString(props, "id"); size_t i; + /* If the device doesn't have an alias we can't override it's props */ + if (!alias) + return; + for (i =3D 0; i < nsdef->ndeviceOverride; i++) { qemuDomainXmlNsDeviceOverride *dev =3D nsdef->deviceOverride + i; size_t j; --=20 2.36.1