From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.151; helo=mga17.intel.com; envelope-from=star.zeng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 0378B21A143EF for ; Tue, 10 Jul 2018 20:51:31 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Jul 2018 20:51:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,336,1526367600"; d="scan'208";a="55604379" Received: from shwdeopenpsi068.ccr.corp.intel.com ([10.239.158.46]) by orsmga007.jf.intel.com with ESMTP; 10 Jul 2018 20:51:30 -0700 From: Star Zeng To: edk2-devel@lists.01.org Cc: Star Zeng , Michael D Kinney , Jiewen Yao , Yonghong Zhu Date: Wed, 11 Jul 2018 11:51:24 +0800 Message-Id: <1531281086-225316-2-git-send-email-star.zeng@intel.com> X-Mailer: git-send-email 2.7.0.windows.1 In-Reply-To: <1531281086-225316-1-git-send-email-star.zeng@intel.com> References: <1531281086-225316-1-git-send-email-star.zeng@intel.com> Subject: [PATCH 1/3] MdeModulePkg CapsuleApp: Check Arg count for -D option X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jul 2018 03:51:32 -0000 Cc: Michael D Kinney Cc: Jiewen Yao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng --- 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