mirror of https://github.com/acidanthera/audk.git
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
This commit is contained in:
parent
072d611689
commit
f20076daaf
|
@ -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;
|
||||
}
|
||||
|
||||
if (Daylight != 0xFF) {
|
||||
TheTime.Daylight = Daylight;
|
||||
}
|
||||
|
||||
Status = gRT->SetTime(&TheTime);
|
||||
|
||||
|
|
Loading…
Reference in New Issue