From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com []) by mx.groups.io with SMTP id smtpd.web11.565.1572588865857342767 for ; Thu, 31 Oct 2019 23:14:28 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=fail (domain: intel.com, ip: , mailfrom: shenglei.zhang@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Oct 2019 23:14:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,254,1569308400"; d="scan'208";a="204426480" Received: from shenglei-dev.ccr.corp.intel.com ([10.239.158.52]) by orsmga006.jf.intel.com with ESMTP; 31 Oct 2019 23:14:27 -0700 From: "Zhang, Shenglei" To: devel@edk2.groups.io Cc: Dandan Bi , Eric Dong Subject: [PATCH v3 2/4] MdeModulePkg/HiiDatabaseDxe: ASSERT StringPtr Date: Fri, 1 Nov 2019 14:14:15 +0800 Message-Id: <20191101061417.28896-3-shenglei.zhang@intel.com> X-Mailer: git-send-email 2.18.0.windows.1 In-Reply-To: <20191101061417.28896-1-shenglei.zhang@intel.com> References: <20191101061417.28896-1-shenglei.zhang@intel.com> The caller of CompareAndMergeDefaultString has checked that AltCfgResp must contain AltConfigHdr. So we add ASSERT to assume StringPtr is not NULL. Cc: Dandan Bi Cc: Eric Dong Signed-off-by: Shenglei Zhang Reviewed-by: Dandan Bi --- MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c | 1 + 1 file changed, 1 insertion(+) diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c index 71ea25bc19bf..2cad6d29f455 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c @@ -909,6 +909,7 @@ CompareAndMergeDefaultString ( // To find the with AltConfigHdr in AltCfgResp, ignore other which follow it. // StringPtr = StrStr (*AltCfgResp, AltConfigHdr); + ASSERT (StringPtr != NULL); StringPtrNext = StrStr (StringPtr + 1, L"&GUID"); if (StringPtrNext != NULL) { TempCharA = *StringPtrNext; -- 2.18.0.windows.1