From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR01-DB5-obe.outbound.protection.outlook.com (EUR01-DB5-obe.outbound.protection.outlook.com [40.107.15.45]) by mx.groups.io with SMTP id smtpd.web10.897.1582009454828030550 for ; Mon, 17 Feb 2020 23:04:15 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@nxp.com header.s=selector2 header.b=NFvoUQq/; spf=pass (domain: nxp.com, ip: 40.107.15.45, mailfrom: gaurav.jain@nxp.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cpg6+J58ZOsd2KRjl/+1rAFeiTShdwndnNN04m0V1R5HhT2Pu6CAocIitWa3MIqpiZOnnnCsN7vY+K4DB4ekVCs6citc7dnBLOAm8caeNXhphppUq9YNcd9xazQwKoNWjWHfWUrmGxfbQrrF4MYj6Joji5hccuLeW5MHEI6A4+Dv2Q6jv6auJ2T13JrHt7pgYLM8jaIxMe3hnQmLISIDXYkaMrtf0Dm/Qadww0zkQ8H34aX4rufKZtu1J7AXsp3wH5y1xAEVj0t5tUsEegIBhVxr+qR2mN0J4Km8qX6wNQOBAJRqwEU9v8Tai0KJXhRIDc0YDHnDxi6hhKE8J+MIwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Zk6/Smy9pgTTG3uhZ/d208OENrDhpStc/w9JpiLdza8=; b=dMzdgGKIaVA+zJ935KMih3miI/zLUss3TJSOi7x1bqG/RJok75oFm4e8esZtLuV2c0ItS6y0YdZ1CxpW7s8pQfoMCitrVW/6s8wxu4OrrorsHF4xyXHiijPVBX4ZMlE/DO8mVyVbSryUv3UQ6dOmhkts40iBEwg4Ia15OqJv7+AfWsuPhcR8wrd6SXcmNLthcxLt5NGnnFYF5sq3D009JoeQAYMRuudmGC6FaU88H8ICtphIztMbKLe5Cvj/KCDOND1hFwkL+yxQZLVmM6fG3zmGbzQjzH5jwUignG8Wdr3sGCk3AkIoZO5FxLAvt1p/OPiZShjJ1k0uLbaxqH33dQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Zk6/Smy9pgTTG3uhZ/d208OENrDhpStc/w9JpiLdza8=; b=NFvoUQq/FmzxrXhgJnm+b4NeOtft75hP0nfYo3Mq2hsUCuFCYXAPKxHjXky2BLw0kzMtAiG2mUTolhW4yw04FvvjyNpsCBtM8adA7D5QovYhWseHMSt/b6kjrFX84CxI0wl2u9BCfQevfCRFvFuq4VvHXyVQLuvlWyYE82aQKyI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=gaurav.jain@nxp.com; Received: from DB7PR04MB4091.eurprd04.prod.outlook.com (52.134.110.144) by DB7PR04MB4220.eurprd04.prod.outlook.com (52.135.131.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.29; Tue, 18 Feb 2020 07:04:12 +0000 Received: from DB7PR04MB4091.eurprd04.prod.outlook.com ([fe80::183:969:2508:3c92]) by DB7PR04MB4091.eurprd04.prod.outlook.com ([fe80::183:969:2508:3c92%6]) with mapi id 15.20.2729.032; Tue, 18 Feb 2020 07:04:12 +0000 From: "Gaurav Jain" To: devel@edk2.groups.io CC: Leif Lindholm , Ard Biesheuvel , Pankaj Bansal , Gaurav Jain Subject: [PATCH v2 1/1] EmbeddedPkg: Fixed Asserts in SCT Runtime Services test. Date: Tue, 18 Feb 2020 17:53:54 +0530 Message-ID: <20200218122354.17591-1-gaurav.jain@nxp.com> X-Mailer: git-send-email 2.17.1 X-ClientProxiedBy: BMXPR01CA0002.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:d::12) To DB7PR04MB4091.eurprd04.prod.outlook.com (2603:10a6:5:1e::16) Return-Path: gaurav.jain@nxp.com MIME-Version: 1.0 Received: from uefi-workstation.ap.freescale.net (92.120.1.69) by BMXPR01CA0002.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:d::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.25 via Frontend Transport; Tue, 18 Feb 2020 07:04:11 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [92.120.1.69] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: d3d021ed-d4f9-4d16-cd78-08d7b440c1ff X-MS-TrafficTypeDiagnostic: DB7PR04MB4220:|DB7PR04MB4220: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2512; X-Forefront-PRVS: 031763BCAF X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4636009)(346002)(136003)(376002)(366004)(396003)(39860400002)(189003)(199004)(6486002)(52116002)(6916009)(54906003)(86362001)(956004)(316002)(1076003)(6506007)(5660300002)(44832011)(478600001)(16526019)(186003)(2906002)(2616005)(81166006)(8936002)(66556008)(66946007)(66476007)(6512007)(6666004)(36756003)(8676002)(4326008)(26005)(81156014);DIR:OUT;SFP:1101;SCL:1;SRVR:DB7PR04MB4220;H:DB7PR04MB4091.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YWIbckQD6bQt58bitJy31kyIJlDsb2ph7OLZysDifcyXbjLdCRJ+Ll1G/EstH4vsw2HZg4+oein/lwAvNnWPRddXSu5jqOvJ7v+TZ/1WySna3M8APgHbtxLNS8ti0Gsm9n3y3Ca32AST92C8/PzCjDkoujG1dgeE0Co3z96Vum4DKYPWVhZk0VTGF62Aci6wljeZ+LkklRqKU0de40W/WukJgbLfFRQLu3dIphgn7ieJB9Y6e9M8UeNELyI+YJ1BsEXqgIPFiQsn2BWacjNbA2qMav1H2FpkHOtQKXh+bCQxNIBDgn4+8Trv2Vcg13rW9krEslC4XVFqGJMWaVdpY2by7InHeOF1rLnVEHmuKFYI1769GFpGTzrd3Z8uKL+PGIiMg5l6Ff/oarqf/idGWTZ23VMCX5PoP/ceJ+8uahtZ0jdfUUGup6APcYn+Mp2C X-MS-Exchange-AntiSpam-MessageData: spIGHB+njje2GD97AgHeX8dohLjfmt7JjbIX7JTvFgovaj/k3ZTlzMYNqJV3eTRZ1VJXtSepZ9/USSzblIjqcASkTx+kQpW1y1TCuP/MaPJbCWy86sHYGubW8O/zz3ax2GUVML48JUX6x02cu1oH2A== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d3d021ed-d4f9-4d16-cd78-08d7b440c1ff X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Feb 2020 07:04:12.3107 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Ec1a1gdByhIaZfAxBFWT4/hfdTAn0mjMur5DgxGYY9DnUGdhQeYBLyrQW4TuLw295rbjj+YS8wQSrJErczw+ag== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4220 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain ASSERT in SetTime_Conf and SetWakeupTime_Conf Consistency Test. SCT Test expect return as Invalid Parameter. So removed ASSERT(). Added Time Validity Checks in SetWakeupTime. Signed-off-by: Gaurav Jain --- Changes in v2: - reverted changes related to valid range of years. --- EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c b/Embedded= Pkg/RealTimeClockRuntimeDxe/RealTimeClock.c index 08fb9b0100b6..70a0d78125b9 100644 --- a/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c +++ b/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c @@ -85,10 +85,6 @@ IsDayValid ( IN EFI_TIME *Time ) { - ASSERT (Time->Day >=3D 1); - ASSERT (Time->Day <=3D mDayOfMonth[Time->Month - 1]); - ASSERT (Time->Month !=3D 2 || IsLeapYear (Time) || Time->Day <=3D 28); - if (Time->Day < 1 || Time->Day > mDayOfMonth[Time->Month - 1] || (Time->Month =3D=3D 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; @@ -254,6 +251,9 @@ SetWakeupTime ( OUT EFI_TIME *Time ) { + if (Time =3D=3D NULL || !IsTimeValid (Time)) { + return EFI_INVALID_PARAMETER; + } return LibSetWakeupTime (Enabled, Time); } =20 --=20 2.17.1