From nobody Sun Feb 8 20:23:00 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1696949828; cv=none; d=zohomail.com; s=zohoarc; b=SiR8159h6gkVcLzIibBBiGYscqIuK7bKqAPzgWhCQvHS0onG8w04qkdxnrNJXDTr9t/wDa2wSnZeB0DTjBNFFeiCrUKnXSCOKZNI8BMlEeXNHsV/dTqwRQ3ls35uSV/z+6YSWDEf0r3F5Kc2Ozyrg5B3Hnl8aG07i9v4d63oVik= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696949828; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=VQJPFIgGK87vBeGLXTZ4ArBRlqU2UpOx90IoQTsBxBw=; b=BkTvW3+C5wcWoUrxAVuOV1nKPRmjuyTnMKAiHV7RLA9feVdpGvdBn23QvGQYSTgTouXYXnIz88+f2OMvUho02Ii3l3HYXKe3yHCsVUnDcY9PAIOKMyENq/5X2G1D9CkwobKRlk7AionvY0J3AqkbBr4/uIJCGV573Wne1kMj9ps= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1696949828945953.6398173192185; Tue, 10 Oct 2023 07:57:08 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-691-vAPtqOoXOgWqo11rsSEXng-1; Tue, 10 Oct 2023 10:56:53 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A7E9128EC101; Tue, 10 Oct 2023 14:56:50 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7D38D9CC; Tue, 10 Oct 2023 14:56:50 +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 4624319465B8; Tue, 10 Oct 2023 14:56:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id D261F1946597 for ; Tue, 10 Oct 2023 14:56:48 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id C220D492B00; Tue, 10 Oct 2023 14:56:48 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B9992492B01 for ; Tue, 10 Oct 2023 14:56:48 +0000 (UTC) Received: from us-smtp-inbound-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A054E101B049 for ; Tue, 10 Oct 2023 14:56:48 +0000 (UTC) Received: from exchange.fintech.ru (exchange.fintech.ru [195.54.195.159]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_DHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-439-iwqeNJkCNRajrlOcSFBGYQ-2; Tue, 10 Oct 2023 10:56:25 -0400 Received: from Ex16-02.fintech.ru (10.0.10.19) by exchange.fintech.ru (195.54.195.169) with Microsoft SMTP Server (TLS) id 14.3.498.0; Tue, 10 Oct 2023 17:55:42 +0300 Received: from infra.fintech.ru (10.10.1.240) by Ex16-02.fintech.ru (10.0.10.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Tue, 10 Oct 2023 17:55:42 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696949828; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=VQJPFIgGK87vBeGLXTZ4ArBRlqU2UpOx90IoQTsBxBw=; b=c1wJr3krwNSOLqpMlMyijvLWi9ofIl9JLWgbQSX4pTawjUVyM/rk9rkIUR/KzQPKV30C6u 5Fi8QI+Rm9S/v4TE7oX2gGrnjTItT+3rmDWGonDLLfTcUbkdUEwcnXs/nr5JV5ID4ATqWr sn29wunWQ9i//ILyAPRp5GO3RGqsGjw= X-MC-Unique: vAPtqOoXOgWqo11rsSEXng-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: iwqeNJkCNRajrlOcSFBGYQ-2 From: Sergey Mironov To: Subject: [PATCH 1/1] The virJSONValueObjectGetString function can return NULL, there are no checks Date: Tue, 10 Oct 2023 17:55:26 +0300 Message-ID: <20231010145526.277548-2-mironov@fintech.ru> In-Reply-To: <20231010145526.277548-1-mironov@fintech.ru> References: <20231010145526.277548-1-mironov@fintech.ru> MIME-Version: 1.0 X-Originating-IP: [10.10.1.240] X-ClientProxiedBy: Ex16-02.fintech.ru (10.0.10.19) To Ex16-02.fintech.ru (10.0.10.19) X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 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: , Cc: Sergey Mironov Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: fintech.ru Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1696949830942100001 Content-Type: text/plain; charset="utf-8" The devAlias check is performed in the "if (!devAlias && !devid) {", so the= situation is not handled when devAlias is NULL, and devid is not NULL Signed-off-by: Sergey Mironov --- src/qemu/qemu_monitor_json.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 5b9edadcf7..80b41d77d3 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -933,6 +933,11 @@ qemuMonitorJSONHandleTrayChange(qemuMonitor *mon, bool trayOpened; int reason; =20 + if (!devAlias) { + VIR_WARN("missing device in tray change event"); + return; + } + /* drive alias is always reported but empty for -blockdev */ if (*devAlias =3D=3D '\0') devAlias =3D NULL; --=20 2.31.1