From nobody Tue Dec 24 02:01:23 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1514946736053422.9446331927709; Tue, 2 Jan 2018 18:32:16 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 633A8222A54E0; Tue, 2 Jan 2018 18:27:11 -0800 (PST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 599F1222A54D7 for ; Tue, 2 Jan 2018 18:27:09 -0800 (PST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Jan 2018 18:32:12 -0800 Received: from fanwang2-hp.ccr.corp.intel.com ([10.239.9.33]) by orsmga001.jf.intel.com with ESMTP; 02 Jan 2018 18:32:11 -0800 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.88; helo=mga01.intel.com; envelope-from=fan.wang@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,500,1508828400"; d="scan'208";a="20931429" From: fanwang2 To: edk2-devel@lists.01.org Date: Wed, 3 Jan 2018 10:31:51 +0800 Message-Id: <1514946711-4056-4-git-send-email-fan.wang@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1514946711-4056-1-git-send-email-fan.wang@intel.com> References: <1514946711-4056-1-git-send-email-fan.wang@intel.com> Subject: [edk2] [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: , Cc: Ye Ting , Wang Fan , Fu Siyuan , Jiaxin Wu MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Wang Fan * In old implementation, the operation len-- assumes AsciiSPrint() has counted NULL terminator, and it's not correct. This patch is to fix this issue. Cc: Fu Siyuan Cc: Ye Ting Cc: Jiaxin Wu Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wang Fan Reviewed-by: Jiaxin Wu --- MdeModulePkg/Library/DxeNetLib/DxeNetLib.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c b/MdeModulePkg/Libr= ary/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); --=20 1.9.5.msysgit.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel