From nobody Thu May 2 00:10:32 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1621508401; cv=none; d=zohomail.com; s=zohoarc; b=Y3Kz7DRc40HROz6eZNuH141NmLuxZQu/+ri6HTQ4IbTdFHie1RkQwMzBfKSON8UeXJvW4pRXVPERmRDAKhWz+rM5ieUDq7HlL2vUM97nlwiphFM/c2vJbdSsbhlmY4F37PHupWK/dZCbdEKXkU8chJZsA7aRy/PsC8SQ50g1Kfs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621508401; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=H3e81/AW9kLFF5hAqwu9hr37N6Lxko7WT+CxD3KORU4=; b=lwfb5IFEDsqVCpfWHzJRID9YK9I5XDiINQ/DIZPHoLCFw8WF44TZtWeVg9zLO4D3y+l3IRzeMqQBEZIo8lk66zeeN77mx3P+JqPuD8gDBsbQ7vsgsHjuqtyXJ3+tVrSiX34u2Ef4Ad0wtgcGit2NQeNZ9GJpMiJAoexI2I2zqRM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621508401130439.93390040888016; Thu, 20 May 2021 04:00:01 -0700 (PDT) Received: from localhost ([::1]:46794 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljgPH-0005G7-MO for importer2@patchew.org; Thu, 20 May 2021 06:59:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42494) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljgOS-0004bN-H8 for qemu-devel@nongnu.org; Thu, 20 May 2021 06:59:09 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:50521) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljgOQ-0006OX-CH for qemu-devel@nongnu.org; Thu, 20 May 2021 06:59:08 -0400 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-274-eMwOuSTVN6OlaYrZzajS4A-1; Thu, 20 May 2021 06:59:01 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 228958AB380; Thu, 20 May 2021 10:59:00 +0000 (UTC) Received: from f33-work.redhat.com (unknown [10.40.194.78]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7934E19718; Thu, 20 May 2021 10:58:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621508344; h=from:from: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; bh=H3e81/AW9kLFF5hAqwu9hr37N6Lxko7WT+CxD3KORU4=; b=OBddE4N0H9S7LJoc/DgeMcDr2BPGFRXdxNTlwOijUh/nlLOhxaymm2J5hcscPie8s/rAVr 9DSbBKITa/KQUHPF7mdTuuOvrhgmbQin7TyzJRSroQc3AjgucZ4irYzixF/5OjHmQewvuI po7iok2nSimc4Rf/wTfFAXldIAIOuNQ= X-MC-Unique: eMwOuSTVN6OlaYrZzajS4A-1 From: Mauro Matteo Cascella To: qemu-devel@nongnu.org Subject: [PATCH] ui/spice-display: check NULL pointer in interface_release_resource() Date: Thu, 20 May 2021 12:58:33 +0200 Message-Id: <20210520105833.183160-1-mcascell@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mcascell@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=mcascell@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.39, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ini.universe@gmail.com, mcascell@redhat.com, kraxel@redhat.com, ppandit@redhat.com Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Check rext.info to avoid potential NULL pointer dereference. A similar check exists in interface_release_resource() in hw/display/qxl.c. Reported-by: Yu Lu Signed-off-by: Mauro Matteo Cascella Reviewed-by: Prasad J Pandit --- ui/spice-display.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ui/spice-display.c b/ui/spice-display.c index d22781a23d..f59c69882d 100644 --- a/ui/spice-display.c +++ b/ui/spice-display.c @@ -561,6 +561,10 @@ static void interface_release_resource(QXLInstance *si= n, SimpleSpiceCursor *cursor; QXLCommandExt *ext; =20 + if (!rext.info) { + return; + } + ext =3D (void *)(intptr_t)(rext.info->id); switch (ext->cmd.type) { case QXL_CMD_DRAW: --=20 2.31.1