public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Star Zeng <star.zeng@intel.com>
To: edk2-devel@lists.01.org
Cc: Star Zeng <star.zeng@intel.com>,
	Michael D Kinney <michael.d.kinney@intel.com>,
	Jiewen Yao <jiewen.yao@intel.com>,
	Yonghong Zhu <yonghong.zhu@intel.com>
Subject: [PATCH 1/3] MdeModulePkg CapsuleApp: Check Arg count for -D option
Date: Wed, 11 Jul 2018 11:51:24 +0800	[thread overview]
Message-ID: <1531281086-225316-2-git-send-email-star.zeng@intel.com> (raw)
In-Reply-To: <1531281086-225316-1-git-send-email-star.zeng@intel.com>

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>
---
 MdeModulePkg/Application/CapsuleApp/CapsuleApp.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c b/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c
index 3a1a0a1cb2e6..90f1a02d9af6 100644
--- a/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c
+++ b/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c
@@ -792,6 +792,10 @@ UefiMain (
     return EFI_INVALID_PARAMETER;
   }
   if (StrCmp(Argv[1], L"-D") == 0) {
+    if (Argc < 3) {
+      Print(L"CapsuleApp: NO input capsule name.\n");
+      return EFI_INVALID_PARAMETER;
+    }
     Status = DumpCapsule(Argv[2]);
     return Status;
   }
-- 
2.7.0.windows.1



  reply	other threads:[~2018-07-11  3:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-11  3:51 [PATCH 0/3] CapsuleApp: Some enhancements Star Zeng
2018-07-11  3:51 ` Star Zeng [this message]
2018-07-11  3:51 ` [PATCH 2/3] MdeModulePkg CapsuleApp: Refine -D option help information Star Zeng
2018-07-11  3:51 ` [PATCH 3/3] MdeModulePkg CapsuleApp: Fix typo EFI_CAPSULE_RPORT_GUID Star Zeng
2018-07-11  7:20 ` [PATCH 0/3] CapsuleApp: Some enhancements Yao, Jiewen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1531281086-225316-2-git-send-email-star.zeng@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox