MdeModulePkg CapsuleApp: Check Arg count for -D option
authorStar Zeng <star.zeng@intel.com>
Wed, 11 Jul 2018 03:45:50 +0000 (11:45 +0800)
committerStar Zeng <star.zeng@intel.com>
Fri, 13 Jul 2018 02:32:16 +0000 (10:32 +0800)
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
MdeModulePkg/Application/CapsuleApp/CapsuleApp.c

index 3a1a0a1..90f1a02 100644 (file)
@@ -792,6 +792,10 @@ UefiMain (
     return EFI_INVALID_PARAMETER;\r
   }\r
   if (StrCmp(Argv[1], L"-D") == 0) {\r
+    if (Argc < 3) {\r
+      Print(L"CapsuleApp: NO input capsule name.\n");\r
+      return EFI_INVALID_PARAMETER;\r
+    }\r
     Status = DumpCapsule(Argv[2]);\r
     return Status;\r
   }\r