From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=jiaxin.wu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 953C8222A54D8 for ; Tue, 2 Jan 2018 21:58:27 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Jan 2018 22:03:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,500,1508828400"; d="scan'208";a="8010596" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga006.jf.intel.com with ESMTP; 02 Jan 2018 22:03:29 -0800 Received: from fmsmsx124.amr.corp.intel.com (10.18.125.39) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 2 Jan 2018 22:03:29 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx124.amr.corp.intel.com (10.18.125.39) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 2 Jan 2018 22:03:29 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.213]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.152]) with mapi id 14.03.0319.002; Wed, 3 Jan 2018 14:03:27 +0800 From: "Wu, Jiaxin" To: "Wang, Fan" , "edk2-devel@lists.01.org" CC: "Fu, Siyuan" , "Ye, Ting" Thread-Topic: [Patch 3/3] MdeModulePkg/DxeNetLib: Fix an error in packet length counting. Thread-Index: AQHThDsU7NX1YNoGCkK2lYXMkZJ5oqNhqKfg Date: Wed, 3 Jan 2018 06:03:27 +0000 Message-ID: <895558F6EA4E3B41AC93A00D163B727416358DA6@SHSMSX103.ccr.corp.intel.com> References: <1514946711-4056-1-git-send-email-fan.wang@intel.com> <1514946711-4056-4-git-send-email-fan.wang@intel.com> In-Reply-To: <1514946711-4056-4-git-send-email-fan.wang@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYWRmYTljZDItY2IyMi00OTE0LTlmNGYtMjhiNzM0YmJmNDU3IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IjdwdGxpUmxmVU5veDJHRERIaUwzSDluVUd5Q2JWNEZLTzB2MmRaRU9uVXM9In0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch 3/3] MdeModulePkg/DxeNetLib: Fix an error in packet length counting. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jan 2018 05:58:28 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jiaxin Wu > -----Original Message----- > From: Wang, Fan > Sent: Wednesday, January 3, 2018 10:32 AM > To: edk2-devel@lists.01.org > Cc: Wang, Fan ; Fu, Siyuan ; Ye, > Ting ; Wu, Jiaxin > Subject: [Patch 3/3] MdeModulePkg/DxeNetLib: Fix an error in packet lengt= h > counting. >=20 > From: Wang Fan >=20 > * In old implementation, the operation len-- assumes AsciiSPrint() > has counted NULL terminator, and it's not correct. This patch is > to fix this issue. >=20 > Cc: Fu Siyuan > Cc: Ye Ting > Cc: Jiaxin Wu > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Wang Fan > --- > MdeModulePkg/Library/DxeNetLib/DxeNetLib.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) >=20 > diff --git a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c > b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c > index 90f17b7..cbce28f 100644 > --- a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c > +++ b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c > @@ -401,22 +401,21 @@ SyslogBuildPacket ( > Time.Day, > Time.Hour, > Time.Minute, > Time.Second > ); > - Len--; >=20 > Len +=3D (UINT32) AsciiSPrint ( > Buf + Len, > BufLen - Len, > "Tiano %a: %a (Line: %d File: %a)", > Module, > Message, > Line, > File > ); > - Len--; > + Len ++; >=20 > // > // OK, patch the IP length/checksum and UDP length fields. > // > Len +=3D sizeof (EFI_UDP_HEADER); > -- > 1.9.5.msysgit.1