From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (EUR05-DB8-obe.outbound.protection.outlook.com [40.107.20.40]) by mx.groups.io with SMTP id smtpd.web10.3896.1580360926911027150 for ; Wed, 29 Jan 2020 21:08:47 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nxp.com header.s=selector2 header.b=oxk7gR9A; spf=pass (domain: nxp.com, ip: 40.107.20.40, mailfrom: gaurav.jain@nxp.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BdbpNLHc8UemuEaMB7oCgBHlHyNx+KIl2hp7Ph4QLIoHZ6g/m6VtJ5YfD73S/4TGasrLebkHZ5daQFp1rSknhdfwPN+ZBNFYXX6BgYZtrRClzT4aS/0GiIbZotOjCjjdjm03Xn2X+ap5gWS2bTgEmJhYzrfDx5BY5aAXz58dTi8mo13EjVxJIBbjC49QlDHQw9ZfsnIsgzUtfMfhHJEH3m5E839ln2qAFRXBt8d2vdQhB60HE4qTpXcAxOOug40b7S+klIiQ32LJ2tc+TvyWKci/Ss2tkHFWX7OCkdu5bQprK4hgskUT9SrbGgPqTh+mRcs5uW9GcChsFiFTfFknVQ== 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=2gnIjxBBLLShwDHVrZwMkI3bED1YDUQ8S4QXArfn/w4=; b=Stg21qP6997gIl3cZSaVkInc6OIfftSvWIKBdne/0lfz6O8PA6uhcsdBt4VXglnILDpC8iT9u2s7OY7DKHgkhILmcK1uWWkXlP0F3ryStwVVRO+bjdi6+xpmxpl8vDcOViKwyMhF24Kyp+3f5RNpg3btdQkELNj5Dux34whkIeG58z/MEe9iggspQSSZ5wvOB0ZxsLoymjp6dqBTVnuiQMH0vzWAIv/1WIsb4VyH4LOjylClawkMC3P6tSElSqNf4Eq9NBIYluub25nvL4TY1GKpTKpu1WWrDpylDB6mmQuHtaZJH5sd6S4Go98zdOVNj88u71OQ+zSO73ihPq7NlA== 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=2gnIjxBBLLShwDHVrZwMkI3bED1YDUQ8S4QXArfn/w4=; b=oxk7gR9AedMuKPTUbzaOv0hXCS/6f8NCUZpWGpWCJNb8OM8/IgOwwTilkfo8h9zzynAJi15LDPg+XjbDEFahLUSwet6bsdDZXFJfkWSiRwqVYz3I778i/PjcbfpmcbuxO+71YK2BCAFpN5mnZw/xIPO8a+0u7pQufl8enc2OfyM= Received: from DB7PR04MB4091.eurprd04.prod.outlook.com (52.134.110.144) by DB7PR04MB4585.eurprd04.prod.outlook.com (52.135.138.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2665.20; Thu, 30 Jan 2020 05:08:44 +0000 Received: from DB7PR04MB4091.eurprd04.prod.outlook.com ([fe80::811d:4963:2158:c3f7]) by DB7PR04MB4091.eurprd04.prod.outlook.com ([fe80::811d:4963:2158:c3f7%5]) with mapi id 15.20.2665.027; Thu, 30 Jan 2020 05:08:44 +0000 Received: from uefi-workstation.ap.freescale.net (92.120.1.69) by PN1PR01CA0075.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:1::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2665.20 via Frontend Transport; Thu, 30 Jan 2020 05:08:43 +0000 From: Gaurav Jain To: "devel@edk2.groups.io" CC: Leif Lindholm , Ard Biesheuvel , Pankaj Bansal , Gaurav Jain Subject: [PATCH 1/1] EmbeddedPkg: Fixed Asserts in SCT Runtime Services test. Thread-Topic: [PATCH 1/1] EmbeddedPkg: Fixed Asserts in SCT Runtime Services test. Thread-Index: AQHV1ytYnfQPvNr380Wd+DvI0bjj4w== Date: Thu, 30 Jan 2020 05:08:44 +0000 Message-ID: <20200130102826.20759-1-gaurav.jain@nxp.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PN1PR01CA0075.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:1::15) To DB7PR04MB4091.eurprd04.prod.outlook.com (2603:10a6:5:1e::16) authentication-results: spf=none (sender IP is ) smtp.mailfrom=gaurav.jain@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 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: 37d1ad61-3117-4124-fe7a-08d7a5427aeb x-ms-traffictypediagnostic: DB7PR04MB4585:|DB7PR04MB4585: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3513; x-forefront-prvs: 02981BE340 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(4636009)(366004)(376002)(396003)(346002)(136003)(39860400002)(199004)(189003)(478600001)(86362001)(66446008)(66946007)(66476007)(64756008)(36756003)(6916009)(2906002)(71200400001)(4326008)(1076003)(8936002)(186003)(26005)(16526019)(6512007)(8676002)(66556008)(81156014)(6486002)(81166006)(5660300002)(52116002)(6506007)(2616005)(316002)(44832011)(956004)(54906003);DIR:OUT;SFP:1101;SCL:1;SRVR:DB7PR04MB4585;H:DB7PR04MB4091.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX: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: jxNSp/xiM1mQTko6IGWYBYNvMPny91eK8aw3wkiUAEV1PXSVKoN65Ld4LFfHNWAPrlDXO0H/BHftqdsZ3pqprh/0pyzawMFfBYhZAo4H8s9xtb/cBJMQJZ/xV3B4kvDFQluOCWXwjC2xRKAUGZZ37dMnS6JuqYM+alcyDk8dhDKNRic8oDV5ZSw06GaPVJ+jk9LzWzxmKd33M4EbbFulGE2657y2k2ubJEFh6tn5DUMd8TELRjQVlJybpedDJ54pjRwqKAO6Yb8PyFH4HYE0nCqWtrdMnu8sawYH6WmKhwEtnln6DA9hOvnq2+zE+29do10Ilv0sQSEkG6Rp2c9ZmsGLRyzyFcGnWFQZnq++Ur8NZNnZjfuHZalyO+2ZFI0ZW3Wd766BLAM1OAmoZXdIY+LzxCc5qg/Ra3FdGsp+kd70skTkIhpI7AWFbtq/3Vlx x-ms-exchange-antispam-messagedata: Ga5N7fntX8yPV+c0bDT/eMT+kjZO0+8iZYKugCdrEtTdAfZtcU7F2mLS9VTchfTbSmwj/Ya7wltdqa/CpqwL7+EYw9UgLjHeluh8uoR4PxsfurIVTZUhJQLD3Zn1Ua5V4feZwLtHqKtwz5h2/WDlgg== MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 37d1ad61-3117-4124-fe7a-08d7a5427aeb X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Jan 2020 05:08:44.6914 (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: hm/aNWiQ/L/Zyzh2BLz13pHLDKn+Zz7MuGma2092gCW5fdyaNQATE6DFvTtfcUvUSnWrVbgVV5cn0150KW6G8A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4585 Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable ASSERT in SetTime_Conf and SetWakeupTime_Conf Consistency Test. SCT Test expect return as Invalid Parameter. So removed ASSERT(). Signed-off-by: Gaurav Jain --- EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c b/Embedded= Pkg/RealTimeClockRuntimeDxe/RealTimeClock.c index 08fb9b0100b6..9bfb7756f0cb 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)) { @@ -105,14 +101,15 @@ IsTimeValid( ) { // Check the input parameters are within the range specified by UEFI - if (Time->Year < 1900 || - Time->Year > 9999 || + if (Time->Year < 1998 || + Time->Year > 2099 || Time->Month < 1 || Time->Month > 12 || !IsDayValid (Time) || 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