]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellLevel3CommandsLib/Help.c
ShellPkg/hexedit: Fix a read-after-free bug
[mirror_edk2.git] / ShellPkg / Library / UefiShellLevel3CommandsLib / Help.c
index a71ade3a20cc43fa0d9e47a95f269dbc53ed2175..f6159c133585b67c5ab208c53e3e5364a1a414e6 100644 (file)
@@ -397,7 +397,7 @@ ShellCommandRunHelp (
         CopyListOfCommandNamesWithDynamic(&SortedCommandList, &SortedCommandListSize);\r
 \r
         for (CurrentCommand = SortedCommandList \r
-          ; CurrentCommand != NULL && *CurrentCommand != CHAR_NULL && CurrentCommand < SortedCommandList + SortedCommandListSize/sizeof(CHAR16)\r
+          ; CurrentCommand != NULL && CurrentCommand < SortedCommandList + SortedCommandListSize/sizeof(CHAR16) && *CurrentCommand != CHAR_NULL\r
           ; CurrentCommand += StrLen(CurrentCommand) + 1\r
           ) {\r
           //\r