From nobody Thu May 16 19:50:39 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+108345+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+108345+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1694040125; cv=none; d=zohomail.com; s=zohoarc; b=iUKPtT/19RhVhmESimiopcQJ3LACtxrLEzbFja0MnBdUmascC+rz0nY8uuUUk4qvCLTWitnYI9vdvTpNc30N+R4D/xm2nyYjfaGBjd93pmXxEESB8KxK6diFUTJVpPbJDaD81MGkR2PlHxtRBiLpTTqNHGpcE8BA773SeQPc09M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1694040125; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=vwmDWF2SAXhW+x8vAb/R6o1edPhSS7E1hR5KIAgHC4I=; b=XkLVUsy8KUqGnStbCC3LDUGgjmF63DNupGAwLD1fuui7/3nePURpCB6TSsMjiW6sslaoknW7Wdd8lp49BgECkxHzJ7Fx4/njNfE3Xf//xtO8NQW4kiiu55hWUb8fkoZ1sEQamikdkrUm45BWLUj5PN0PGurhasFYk6wjTkXPUrw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+108345+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1694040125235187.15794391555983; Wed, 6 Sep 2023 15:42:05 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=HZ72NIeWR5yU03kJ5D3/Uovsnb86Pa2tNCrdR4JCMG8=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1694040124; v=1; b=ILKqflsDjCvDaoRCx0s9Z8hTeDhH8UPod9jfkNWlbf8Il5syMrQk7wvLs9rrLTT/uv5jWBdj p3vk5sEdysU+/g/4p4Y8vrpPd6kOx0QFBxkgNVGrmNfRQQhnLes5RbtYB0IsquxxgIBhh3WE/Lg tYtVzJ5wbGJUM4HyZgD7sZyI= X-Received: by 127.0.0.2 with SMTP id DqtUYY1788612xOhlqqc2GDn; Wed, 06 Sep 2023 15:42:04 -0700 X-Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) by mx.groups.io with SMTP id smtpd.web10.51.1694040124170257527 for ; Wed, 06 Sep 2023 15:42:04 -0700 X-Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-31aeedbb264so430460f8f.0 for ; Wed, 06 Sep 2023 15:42:03 -0700 (PDT) X-Gm-Message-State: ZWa2uVsclfMrMe0YOFED2sRex1787277AA= X-Google-Smtp-Source: AGHT+IEXZeN6PTLP5onJ/EN9qbJLcSZDszQyrWMkSO2NLnqXMllPgSl9THZBpG5Jwo1CNDXvH3PZlg== X-Received: by 2002:a5d:55c7:0:b0:317:6992:855c with SMTP id i7-20020a5d55c7000000b003176992855cmr3473477wrw.19.1694040121913; Wed, 06 Sep 2023 15:42:01 -0700 (PDT) X-Received: from Michaels-iMac.lan ([193.219.99.195]) by smtp.gmail.com with ESMTPSA id t2-20020a05600001c200b003196e992567sm21640460wrx.115.2023.09.06.15.42.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Sep 2023 15:42:01 -0700 (PDT) From: "Mike Beaton" To: devel@edk2.groups.io Cc: Eric Dong , Dandan Bi , Ard Biesheuvel , Mike Beaton Subject: [edk2-devel] [PATCH v4] MdeModulePkg/HiiDatabase: Fix incorrect AllocateCopyPool size Date: Wed, 6 Sep 2023 23:41:19 +0100 Message-ID: <20230906224118.8749-2-mjsbeaton@gmail.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: 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,mjsbeaton@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1694040125987100002 Content-Type: text/plain; charset="utf-8" AsciiStrLen is one byte too short, thus whether the space allocated is real= ly sufficient and whether the resultant string is really null-terminated becom= es implementation-dependent. An explicitly compile-time string length calculat= ion might be even more ideal, but AsciiStrSize matches usage elsewhere in the codebase. Signed-off-by: Mike Beaton --- MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c b= /MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c index 96e05d4cf9..f67b7760f0 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c @@ -1987,7 +1987,7 @@ GetNameFromId ( NULL ); if (BestLanguage =3D=3D NULL) { - BestLanguage =3D AllocateCopyPool (AsciiStrLen ("en-US"), "en-US"); + BestLanguage =3D AllocateCopyPool (AsciiStrSize ("en-US"), "en-US"); ASSERT (BestLanguage !=3D NULL); } =20 --=20 2.41.0 -=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 (#108345): https://edk2.groups.io/g/devel/message/108345 Mute This Topic: https://groups.io/mt/101204385/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-