summaryrefslogtreecommitdiff
path: root/ShellPkg/Library
diff options
context:
space:
mode:
authorjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>2011-04-19 16:55:51 +0000
committerjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>2011-04-19 16:55:51 +0000
commitf20076daaf8509e815a37fd0cb5453b9c3b9a79d (patch)
tree99b8fbac57008da1609c507a7c023faea4ccc32c /ShellPkg/Library
parent072d611689f18d203c922786113c6e39c6f4b878 (diff)
downloadedk2-platforms-f20076daaf8509e815a37fd0cb5453b9c3b9a79d.tar.xz
fix user input validation for time command.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11567 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg/Library')
-rw-r--r--ShellPkg/Library/UefiShellLevel2CommandsLib/TimeDate.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/TimeDate.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/TimeDate.c
index 780b39e2fd..abefee3f3a 100644
--- a/ShellPkg/Library/UefiShellLevel2CommandsLib/TimeDate.c
+++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/TimeDate.c
@@ -298,7 +298,7 @@ CheckAndSetTime (
if (TimeString != NULL && !InternalIsTimeLikeString(TimeString, L':', 1, 2, FALSE)) {
return (SHELL_INVALID_PARAMETER);
}
- if (((Daylight & (EFI_TIME_IN_DAYLIGHT|EFI_TIME_ADJUST_DAYLIGHT)) != Daylight)) {
+ if (Daylight != 0xFF &&((Daylight & (EFI_TIME_IN_DAYLIGHT|EFI_TIME_ADJUST_DAYLIGHT)) != Daylight)) {
return (SHELL_INVALID_PARAMETER);
}
@@ -341,7 +341,9 @@ CheckAndSetTime (
TheTime.TimeZone = Tz;
}
- TheTime.Daylight = Daylight;
+ if (Daylight != 0xFF) {
+ TheTime.Daylight = Daylight;
+ }
Status = gRT->SetTime(&TheTime);