From nobody Fri May 3 12:39:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+49153+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+49153+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1571293278; cv=none; d=zoho.com; s=zohoarc; b=W7x8Pxxsh/R/pHHI0rFRPYoxFLsSulAf6wShCARbF/xNqHVrBPmUr1vGBn8rp6t61CsTC68mF+Agr/bqHj+3cCYZnvd9F7moZ5XBiRTuCVLhfxc83enx9PQeyDXAPlfusklhyGJG3PAjC7j1ZqbhMmU0UotbdHdNciQj+NctARw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571293278; h=Cc:Date:From:List-Id:List-Unsubscribe:Message-ID:Reply-To:Sender:Subject:To; bh=iihm94USZ1I+cDQ5b91guve5fnaJuhIY2fnfpYhH7Z4=; b=H3+PFY3yF7vy7Qh2C2FkKayaqtCQPuPUsX3L1x1VUeGPBnAdPir7uMaYcQtolUqEn79iVC1cSBrKML2sO/w3luJJg+4Nl1FCZodeX313BFbdjhk2XaIc6bOVtR7dxKm8YGNtA3hfj4STGJC5Fbx8DfGEdEuVLRqZdJ/rTTke7vk= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+49153+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1571293278672938.50633847932; Wed, 16 Oct 2019 23:21:18 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id LbznYY1788612xa1NMNYl7m7; Wed, 16 Oct 2019 23:21:18 -0700 X-Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web12.2806.1571293275521352376 for ; Wed, 16 Oct 2019 23:21:15 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Oct 2019 23:21:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,306,1566889200"; d="scan'208";a="208164422" X-Received: from shenglei-dev.ccr.corp.intel.com ([10.239.158.52]) by orsmga002.jf.intel.com with ESMTP; 16 Oct 2019 23:21:13 -0700 From: "Zhang, Shenglei" To: devel@edk2.groups.io Cc: Dandan Bi , Eric Dong Subject: [edk2-devel] [PATCH] MdeModulePkg/HiiDatabaseDxe: Add check for 'Private->Attribute >> 4' Date: Thu, 17 Oct 2019 14:21:10 +0800 Message-Id: <20191017062111.10568-1-shenglei.zhang@intel.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,shenglei.zhang@intel.com X-Gm-Message-State: QpUonyjNBc77JPrCwGgonbWZx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1571293278; bh=UNSNSVtjPqif+RAZZ9FUyQEDm8QF+JhiFA0K9g6bk9o=; h=Cc:Date:From:Reply-To:Subject:To; b=CFjhkFQGGowQwBLMvAXfPuKDfb0I6uu1vMbFpWVxaH06UgpvUlFdXqnmSUUeDMuLrk8 GJmTf7UxC6EoxwmeVmKWdsULA3hARjbFU22Tm0l4rPdODRkYBesD3n57qjR8CKjKq807C VCsBCwHBpmtk9zzaIRhhwqwUXpAnXgcuB2Y= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The size of mHiiEfiColors is 16. mHiiEfiColors[Private->Attribute >> 4] may be out of boundary. So add a check for that. Cc: Dandan Bi Cc: Eric Dong Signed-off-by: Shenglei Zhang --- MdeModulePkg/Universal/HiiDatabaseDxe/Font.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c b/MdeModulePkg/Un= iversal/HiiDatabaseDxe/Font.c index ca63df168c94..282a7a114d17 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c @@ -999,7 +999,12 @@ GetSystemFont ( } =20 Info->ForegroundColor =3D mHiiEfiColors[Private->Attribute & 0x0f]; - Info->BackgroundColor =3D mHiiEfiColors[Private->Attribute >> 4]; + if ((Private->Attribute >> 4) < 16){ + Info->BackgroundColor =3D mHiiEfiColors[Private->Attribute >> 4]; + } else { + return EFI_INVALID_PARAMETER; + } + =20 Info->FontInfoMask =3D EFI_FONT_INFO_SYS_FONT | EFI_FONT_INFO_SYS_= SIZE | EFI_FONT_INFO_SYS_STYLE; Info->FontInfo.FontStyle =3D 0; Info->FontInfo.FontSize =3D EFI_GLYPH_HEIGHT; --=20 2.18.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#49153): https://edk2.groups.io/g/devel/message/49153 Mute This Topic: https://groups.io/mt/34685172/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-