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:
jcarsey 2011-04-19 16:55:51 +00:00
parent 072d611689
commit f20076daaf
1 changed files with 4 additions and 2 deletions

View File

@ -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);