summaryrefslogtreecommitdiffstats
path: root/ShellPkg
diff options
context:
space:
mode:
Diffstat (limited to 'ShellPkg')
-rw-r--r--ShellPkg/Application/Shell/Shell.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/ShellPkg/Application/Shell/Shell.c b/ShellPkg/Application/Shell/Shell.c
index 104f4c8961..ec344137d3 100644
--- a/ShellPkg/Application/Shell/Shell.c
+++ b/ShellPkg/Application/Shell/Shell.c
@@ -1,7 +1,7 @@
/** @file
This is THE shell (application)
- Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2019, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2013-2014 Hewlett-Packard Development Company, L.P.<BR>
Copyright 2015-2018 Dell Technologies.<BR>
This program and the accompanying materials
@@ -1002,7 +1002,11 @@ ProcessCommandLine(
) == 0) {
ShellInfoObject.ShellInitSettings.BitUnion.Bits.Delay = TRUE;
// Check for optional delay value following "-delay"
- DelayValueStr = gEfiShellParametersProtocol->Argv[LoopVar + 1];
+ if ((LoopVar + 1) >= gEfiShellParametersProtocol->Argc) {
+ DelayValueStr = NULL;
+ } else {
+ DelayValueStr = gEfiShellParametersProtocol->Argv[LoopVar + 1];
+ }
if (DelayValueStr != NULL){
if (*DelayValueStr == L':') {
DelayValueStr++;