From nobody Sat May 4 23:54:19 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1498200234893908.0784397484291; Thu, 22 Jun 2017 23:43:54 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 83B7821BBC433; Thu, 22 Jun 2017 23:42:27 -0700 (PDT) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 5326021BBC421 for ; Thu, 22 Jun 2017 23:42:26 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Jun 2017 23:43:51 -0700 Received: from shwdeopenpsi168.ccr.corp.intel.com ([10.239.158.121]) by orsmga003.jf.intel.com with ESMTP; 22 Jun 2017 23:43:50 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,376,1493708400"; d="scan'208";a="984307281" From: Yonghong Zhu To: edk2-devel@lists.01.org Date: Fri, 23 Jun 2017 14:43:48 +0800 Message-Id: <1498200228-8628-1-git-send-email-yonghong.zhu@intel.com> X-Mailer: git-send-email 2.6.1.windows.1 Subject: [edk2] [Patch] BaseTools: report error HiiString in HII format PCD must not be empty X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Add a check that HiiString field in the HII format PCD entry must not be an empty string. Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu Reviewed-by: Liming Gao --- BaseTools/Source/Python/Workspace/MetaFileParser.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/BaseTools/Source/Python/Workspace/MetaFileParser.py b/BaseTool= s/Source/Python/Workspace/MetaFileParser.py index d094403..4a5311a 100644 --- a/BaseTools/Source/Python/Workspace/MetaFileParser.py +++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py @@ -1137,10 +1137,17 @@ class DscParser(MetaFileParser): if len(ValueList) > 1 and ValueList[1] !=3D TAB_VOID \ and self._ItemType in [MODEL_PCD_DYNAMIC_DEF= AULT, MODEL_PCD_DYNAMIC_EX_DEFAULT]: EdkLogger.error('Parser', FORMAT_INVALID, "The datum type '%s'= of PCD is wrong" % ValueList[1], ExtraData=3Dself._CurrentLine, File=3Dself.Met= aFile, Line=3Dself._LineIndex + 1) =20 + # Validate the VariableName of DynamicHii and DynamicExHii for PCD= Entry must not be an empty string + if self._ItemType in [MODEL_PCD_DYNAMIC_HII, MODEL_PCD_DYNAMIC_EX_= HII]: + DscPcdValueList =3D GetSplitValueList(TokenList[1], TAB_VALUE_= SPLIT, 1) + if len(DscPcdValueList[0].replace('L','').replace('"','').stri= p()) =3D=3D 0: + EdkLogger.error('Parser', FORMAT_INVALID, "The VariableNam= e field in the HII format PCD entry must not be an empty string", + ExtraData=3Dself._CurrentLine, File=3Dself.Met= aFile, Line=3Dself._LineIndex + 1) + # if value are 'True', 'true', 'TRUE' or 'False', 'false', 'FALSE'= , replace with integer 1 or 0. DscPcdValueList =3D GetSplitValueList(TokenList[1], TAB_VALUE_SPLI= T, 1) if DscPcdValueList[0] in ['True', 'true', 'TRUE']: self._ValueList[2] =3D TokenList[1].replace(DscPcdValueList[0]= , '1', 1); elif DscPcdValueList[0] in ['False', 'false', 'FALSE']: --=20 2.6.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel