From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0722.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe46::722]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 3D0F91A1DF6 for ; Mon, 22 Aug 2016 20:17:08 -0700 (PDT) Received: from DF4PR84MB0041.NAMPRD84.PROD.OUTLOOK.COM (10.162.192.143) by DF4PR84MB0041.NAMPRD84.PROD.OUTLOOK.COM (10.162.192.143) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.557.21; Tue, 23 Aug 2016 03:16:58 +0000 Received: from DF4PR84MB0041.NAMPRD84.PROD.OUTLOOK.COM ([10.162.192.143]) by DF4PR84MB0041.NAMPRD84.PROD.OUTLOOK.COM ([10.162.192.143]) with mapi id 15.01.0557.027; Tue, 23 Aug 2016 03:16:58 +0000 From: "Subramanian, Sriram (EG Servers Platform SW)" To: Zhang Lubo , "edk2-devel@lists.01.org" CC: Ye Ting , Fu Siyuan , Wu Jiaxin Thread-Topic: [edk2] [patch] MdeModulePkg:Fix bug in function AsciiStrToIp4. Thread-Index: AQHR+e8r9JM3PT08DEeKRe42JvbOKKBV5aQw Date: Tue, 23 Aug 2016 03:16:58 +0000 Message-ID: References: <1471593183-7776-1-git-send-email-lubo.zhang@intel.com> In-Reply-To: <1471593183-7776-1-git-send-email-lubo.zhang@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=sriram-s@hpe.com; x-originating-ip: [15.219.195.2] x-ms-office365-filtering-correlation-id: 80809c18-0abf-4191-ace3-08d3cb03f182 x-microsoft-exchange-diagnostics: 1; DF4PR84MB0041; 6:W3XY9KM5mqGX+q1YFca6I24exRquVrHEf+2+zMkjetQCXl5hgyQj5nocqCH8pa4A+n6wb6M61/Cf0RYa4+iEXVhGeQ3Z6IOQ0E3Bsr0h5bVHETZE+69L1CAGVsDEn8D8Q7RTtB+L+IfE5VB1cSSNWAUswIqBNyEu/GFzFae7w1xFbvBhZoUGJv0EdF+/omouzVS+o0iyIMEeOHe2EvTXWLM5BlpyCaOpZ7cQ1pJorQl5A98XFwLJ8FPI5UDctqUaHlOSkHiPTTL1P7eHMmwh0kiB/l+YmY6oi52Wftb/tTZni9aN9GtbBZrhH52ylUUJLOsLds/LbULvgoDvuzxhAQ==; 5:9MdWGOvyf4fWid0Aky8b9QjyfXEzY5OQQr8C+wLCwGtIpaU0L6spsGJ1HCB5oubNk7SVGgAfazywja7+A/uX6LDPrdb1Fb4cSi3gBhTHTofdjX38P/O05dZ1PJGfKIrBj2ESoQk9XYib4Mht1e90OA==; 24:o4W0s/JusZmJpR6XZqyLaSjqY181bELX/h6AOR1Fb8xWCeQJ5UPKTCaotiyu7+VIQTJ8851MieMj1f6zthktywvxfN0eUt0wO/5P+NNvz/4=; 7:MmMhkfmkxmTtSKKe/iOqt4G9Prfe+VWHJO4s/aZnurKOw7fiCpsUudZtXubBYvuIkhHfsauIo8RTdEPb/EpF4+nwD5H7dVabeOSQEq3AgjSSW0Bv4X568cWwKLeSihpal4xejL3v6AyFIPcQZkXEcNCMqCV+7qc1p8E6swRPf/BWlAP143E9DlLl7zwFlnNJYYhj47DjbdM51nMYEWFhjVk46/dlb1rAXMj3NARMFlJz6T8ExacImRxzaTbLW6+B x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DF4PR84MB0041; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(227479698468861)(150554046322364)(162533806227266)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6055026); SRVR:DF4PR84MB0041; BCL:0; PCL:0; RULEID:; SRVR:DF4PR84MB0041; x-forefront-prvs: 004395A01C x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(6029001)(7916002)(13464003)(199003)(189002)(377454003)(10400500002)(74316002)(3280700002)(2906002)(11100500001)(8936002)(97736004)(189998001)(8676002)(4326007)(5660300001)(81156014)(5001770100001)(105586002)(122556002)(106116001)(305945005)(81166006)(99286002)(9686002)(5002640100001)(50986999)(87936001)(86362001)(76176999)(54356999)(66066001)(15975445007)(7846002)(7696003)(2501003)(77096005)(7736002)(3660700001)(19580395003)(19580405001)(586003)(2900100001)(101416001)(2950100001)(3846002)(33656002)(68736007)(92566002)(102836003)(106356001)(6116002)(19627235001); DIR:OUT; SFP:1102; SCL:1; SRVR:DF4PR84MB0041; H:DF4PR84MB0041.NAMPRD84.PROD.OUTLOOK.COM; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: hpe.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: hpe.com X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Aug 2016 03:16:58.4283 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 105b2061-b669-4b31-92ac-24d304d195dc X-MS-Exchange-Transport-CrossTenantHeadersStamped: DF4PR84MB0041 Subject: Re: [patch] MdeModulePkg:Fix bug in function AsciiStrToIp4. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 03:17:08 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Sriram Subramanian -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Zhan= g Lubo Sent: Friday, August 19, 2016 1:23 PM To: edk2-devel@lists.01.org Cc: Ye Ting ; Fu Siyuan ; Wu Jiaxin= Subject: [edk2] [patch] MdeModulePkg:Fix bug in function AsciiStrToIp4. If a FQDN contains 3 dots '.' like "a.b.c.com", the AsciiStrToIp4 will return success as the HostName has a valid IP address. So we need to check if it is a decimal character before using AsciiStrDecimalToUi= ntn. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo Cc: Fu Siyuan Cc: Ye Ting Cc: Wu Jiaxin Cc: Hegde Nagaraj P --- MdeModulePkg/Library/DxeNetLib/DxeNetLib.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c b/MdeModulePkg/Libr= ary/DxeNetLib/DxeNetLib.c index ef19439..f4376e9 100644 --- a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c +++ b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c @@ -2724,10 +2724,13 @@ NetLibAsciiStrToIp4 ( =20 for (Index =3D 0; Index < 4; Index++) { TempStr =3D Ip4Str; =20 while ((*Ip4Str !=3D '\0') && (*Ip4Str !=3D '.')) { + if (!NET_IS_DIGIT(*Ip4Str)) { + return EFI_INVALID_PARAMETER; + } Ip4Str++; } =20 // // The IPv4 address is X.X.X.X --=20 1.9.5.msysgit.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel