diff options
author | Gaurav Jain <gaurav.jain@nxp.com> | 2020-03-18 15:54:19 +0530 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2020-03-26 18:39:01 +0000 |
commit | 32bcdfa512bda825d968c69cdeb7d5da89ced62e (patch) | |
tree | 02379663dddc5eb60939ac7f1c56790d8013ad50 /EmbeddedPkg | |
parent | 5f7c91f0d72efca3b53628163861265c89306f1f (diff) | |
download | edk2-32bcdfa512bda825d968c69cdeb7d5da89ced62e.tar.gz edk2-32bcdfa512bda825d968c69cdeb7d5da89ced62e.tar.bz2 edk2-32bcdfa512bda825d968c69cdeb7d5da89ced62e.zip |
EmbeddedPkg/RealTimeClockRuntimeDxe: Drop ASSERTs on function arguments
ASSERT in SetTime_Conf Consistency Test.
SCT Test expect return as Invalid Parameter.
So removed ASSERT().
While at it, check that the NanoSecond field is within the range given
by the UEFI specification.
Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Diffstat (limited to 'EmbeddedPkg')
-rw-r--r-- | EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c b/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c index 08fb9b0100..20f1fa640e 100644 --- a/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c +++ b/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c @@ -85,10 +85,6 @@ IsDayValid ( IN EFI_TIME *Time
)
{
- ASSERT (Time->Day >= 1);
- ASSERT (Time->Day <= mDayOfMonth[Time->Month - 1]);
- ASSERT (Time->Month != 2 || IsLeapYear (Time) || Time->Day <= 28);
-
if (Time->Day < 1 ||
Time->Day > mDayOfMonth[Time->Month - 1] ||
(Time->Month == 2 && !IsLeapYear (Time) && Time->Day > 28)) {
@@ -113,6 +109,7 @@ IsTimeValid( Time->Hour > 23 ||
Time->Minute > 59 ||
Time->Second > 59 ||
+ Time->Nanosecond > 999999999 ||
!IsValidTimeZone (Time->TimeZone) ||
!IsValidDaylight (Time->Daylight)) {
return FALSE;
|