https://git.reactos.org/?p=reactos.git;a=commitdiff;h=166b88f95c1eed0be0340a...
commit 166b88f95c1eed0be0340a25ba73da5911521159 Author: Eric Kohl eric.kohl@reactos.org AuthorDate: Sat May 28 09:54:46 2022 +0200 Commit: Eric Kohl eric.kohl@reactos.org CommitDate: Sat May 28 09:54:46 2022 +0200
[DISKPART] Fix crashes in the interpreter --- base/system/diskpart/interpreter.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/base/system/diskpart/interpreter.c b/base/system/diskpart/interpreter.c index 5e4eafa47ee..d2decf537f1 100644 --- a/base/system/diskpart/interpreter.c +++ b/base/system/diskpart/interpreter.c @@ -128,20 +128,20 @@ InterpretCmd( for (cmdptr = cmds; cmdptr->cmd1; cmdptr++) { if ((cmdptr1 == NULL) && - (wcsicmp(argv[0], cmdptr->cmd1) == 0)) + (cmdptr->cmd1 != NULL) && (wcsicmp(argv[0], cmdptr->cmd1) == 0)) cmdptr1 = cmdptr;
if ((cmdptr2 == NULL) && (argc >= 2) && - (wcsicmp(argv[0], cmdptr->cmd1) == 0) && - (wcsicmp(argv[1], cmdptr->cmd2) == 0)) + (cmdptr->cmd1 != NULL) && (wcsicmp(argv[0], cmdptr->cmd1) == 0) && + (cmdptr->cmd2 != NULL) && (wcsicmp(argv[1], cmdptr->cmd2) == 0)) cmdptr2 = cmdptr;
if ((cmdptr3 == NULL) && (argc >= 3) && - (wcsicmp(argv[0], cmdptr->cmd1) == 0) && - (wcsicmp(argv[1], cmdptr->cmd2) == 0) && - (wcsicmp(argv[2], cmdptr->cmd3) == 0)) + (cmdptr->cmd1 != NULL) && (wcsicmp(argv[0], cmdptr->cmd1) == 0) && + (cmdptr->cmd2 != NULL) && (wcsicmp(argv[1], cmdptr->cmd2) == 0) && + (cmdptr->cmd3 != NULL) && (wcsicmp(argv[2], cmdptr->cmd3) == 0)) cmdptr3 = cmdptr; }