Hi Shenglei, Please update the commit message and subject before commit, since we have added ASSERT code for this case that the StringPtr cannot be NULL instead of adding check. With the commit message updated, Reviewed-by: Dandan Bi <dandan...@intel.com>.
Thanks, Dandan > -----Original Message----- > From: Zhang, Shenglei > Sent: Wednesday, October 30, 2019 10:27 PM > To: devel@edk2.groups.io > Cc: Bi, Dandan <dandan...@intel.com>; Dong, Eric <eric.d...@intel.com> > Subject: [PATCH v2 2/4] MdeModulePkg/HiiDatabaseDxe: Add check for > StringPtr > > If the target string doesn't appear in the searched string, StringPtr will be > NULL. So add a check for that. > > Cc: Dandan Bi <dandan...@intel.com> > Cc: Eric Dong <eric.d...@intel.com> > Signed-off-by: Shenglei Zhang <shenglei.zh...@intel.com> > --- > v2: Instead of returning a value, we add ASSERT to ensure > StringPtr is not NULL. > > 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..19a23fcc951e 100644 > --- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c > +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c > @@ -909,6 +909,7 @@ CompareAndMergeDefaultString ( > // To find the <AltResp> with AltConfigHdr in AltCfgResp, ignore other > <AltResp> 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 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#49788): https://edk2.groups.io/g/devel/message/49788 Mute This Topic: https://groups.io/mt/39808322/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-