From nobody Mon Feb 9 13:39:19 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+65737+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+65737+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1601424952; cv=none; d=zohomail.com; s=zohoarc; b=kAqTA+1Gb1elOXbcYlT1HDANbNoTTq194tyrfw9tnGO25XsAWxJUpGNrC3E1JQP61epowctvF1tUlAZiktf6ujZK4zYXx7AT0B1g5fZ3oUldiTaHKTCP3a26dIwCR9hpbilpSFbicyp55c3n9Zkg+5nHS2C96/CnopCbBqXFg+c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601424952; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=ku1oFCtALMHkdazLAYwTj6KtcyJcgXZ9LH0Co2rfOR0=; b=eozYqyQoKKkmXvbcSilAbU2s3X/6vBlizdGK6ZB97Udaq2pea+SlsXKxtFXdFgdeO+glwyXgoCki/Q09BAurEZOnKK2Z8I5rMtaEuSyZi4KVpsvt2j4TYyGZn8fv5oUzJCwli82r/5aQUwDZYBXm6Yq3uG2PPvFPHjAV0ZjZHYU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+65737+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 1601424952020738.6482617006839; Tue, 29 Sep 2020 17:15:52 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id YddBYY1788612xCyWxrv5zNF; Tue, 29 Sep 2020 17:15:51 -0700 X-Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web10.4115.1601424950205740244 for ; Tue, 29 Sep 2020 17:15:50 -0700 IronPort-SDR: aGrHRyKUKdVRKK88f5dHYMNYbGsTyuAq28i1NKnnAPyIHccDxYGNTky9uIeiZYQVPeHoMtQrnL X2gTJrhtgzWQ== X-IronPort-AV: E=McAfee;i="6000,8403,9759"; a="159708753" X-IronPort-AV: E=Sophos;i="5.77,320,1596524400"; d="scan'208";a="159708753" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Sep 2020 17:15:48 -0700 IronPort-SDR: hxtTwumQOzt3wSvGLYjBAgFnWKIbhX/eoiB3wpjGXm2kr+BJWkOyK/Q86NsGpiE9rfO/R8ZXut HxB2syAdxi2g== X-IronPort-AV: E=Sophos;i="5.77,320,1596524400"; d="scan'208";a="312397975" X-Received: from nldesimo-desk1.amr.corp.intel.com ([10.209.9.28]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Sep 2020 17:15:43 -0700 From: "Nate DeSimone" To: devel@edk2.groups.io Cc: Chasel Chiu , Liming Gao , Eric Dong Subject: [edk2-devel] [edk2-platforms] [PATCH V1 1/2] MinPlatformPkg: Add missing bounds checks to CompressLib Date: Tue, 29 Sep 2020 17:15:28 -0700 Message-Id: <20200930001529.2212-2-nathaniel.l.desimone@intel.com> In-Reply-To: <20200930001529.2212-1-nathaniel.l.desimone@intel.com> References: <20200930001529.2212-1-nathaniel.l.desimone@intel.com> MIME-Version: 1.0 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,nathaniel.l.desimone@intel.com X-Gm-Message-State: ht1ZK7rkL9V65zDzhDTDreQ5x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1601424951; bh=IThfaQKsC/dBLD2Y1rARl+s29v7LRJRSOmScFr51PXQ=; h=Cc:Date:From:Reply-To:Subject:To; b=UGzSo2aFpoXU03bU8qJsaCc4VyRApSZK6hcw+FiA8/UQHUzvVtKGDQYVh/UdznLU+HB I58LJNDPe8jf3vv8MrKwQOlorieeQFrxMtgW16ODjvYVgG417ht025BU/USAZIaiq9+97 L5O1Vq2mY2opYEWTfPRzDs4nVS5UqMYpLsg= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Current code only as bounds checks in ASSERT macros. They are also needed in release mode where ASSERT is not used. Signed-off-by: Nate DeSimone Cc: Chasel Chiu Cc: Nate DeSimone Cc: Liming Gao Cc: Eric Dong Reviewed-by: Chasel Chiu --- .../MinPlatformPkg/Library/CompressLib/CompressLib.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Platform/Intel/MinPlatformPkg/Library/CompressLib/CompressLib.= c b/Platform/Intel/MinPlatformPkg/Library/CompressLib/CompressLib.c index 9f93e1ee2d..537eb3b693 100644 --- a/Platform/Intel/MinPlatformPkg/Library/CompressLib/CompressLib.c +++ b/Platform/Intel/MinPlatformPkg/Library/CompressLib/CompressLib.c @@ -1002,7 +1002,10 @@ CountTFreq ( mTFreq[2]++; } } else { - ASSERT((LoopVar3+2)<(2 * NT - 1)); + ASSERT ((LoopVar3 + 2) < (2 * NT - 1)); + if ((LoopVar3 + 2) >=3D (2 * NT - 1)) { + return; + } mTFreq[LoopVar3 + 2]++; } } @@ -1101,7 +1104,10 @@ WriteCLen ( PutBits (CBIT, Count - 20); } } else { - ASSERT((LoopVar3+2)=3D NPT) { + return; + } PutBits (mPTLen[LoopVar3 + 2], mPTCode[LoopVar3 + 2]); } } --=20 2.27.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 (#65737): https://edk2.groups.io/g/devel/message/65737 Mute This Topic: https://groups.io/mt/77208968/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-