diff options
author | jcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-04-19 16:55:51 +0000 |
---|---|---|
committer | jcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-04-19 16:55:51 +0000 |
commit | f20076daaf8509e815a37fd0cb5453b9c3b9a79d (patch) | |
tree | 99b8fbac57008da1609c507a7c023faea4ccc32c /ShellPkg | |
parent | 072d611689f18d203c922786113c6e39c6f4b878 (diff) | |
download | edk2-f20076daaf8509e815a37fd0cb5453b9c3b9a79d.zip edk2-f20076daaf8509e815a37fd0cb5453b9c3b9a79d.tar.gz edk2-f20076daaf8509e815a37fd0cb5453b9c3b9a79d.tar.bz2 |
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')
-rw-r--r-- | ShellPkg/Library/UefiShellLevel2CommandsLib/TimeDate.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/TimeDate.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/TimeDate.c index 780b39e..abefee3 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);
|