mirror of https://github.com/acidanthera/audk.git
MdePkg/BaseLib: Add an additional check within AsciiStriCmp
This commit adds an addtional check in AsciiStriCmp. It explicitly checks the end of the sting pointed by 'SecondString' to make the code logic easier for reading and to prevent possible mis-reports by static code checkers. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Hao Wu <Hao.a.wu@intel.com>
This commit is contained in:
parent
526dd0245b
commit
c1f032cd3a
|
@ -1262,7 +1262,7 @@ AsciiStriCmp (
|
|||
|
||||
UpperFirstString = InternalBaseLibAsciiToUpper (*FirstString);
|
||||
UpperSecondString = InternalBaseLibAsciiToUpper (*SecondString);
|
||||
while ((*FirstString != '\0') && (UpperFirstString == UpperSecondString)) {
|
||||
while ((*FirstString != '\0') && (*SecondString != '\0') && (UpperFirstString == UpperSecondString)) {
|
||||
FirstString++;
|
||||
SecondString++;
|
||||
UpperFirstString = InternalBaseLibAsciiToUpper (*FirstString);
|
||||
|
|
Loading…
Reference in New Issue