From: fanwang2 <fan.wang@intel.com>
To: edk2-devel@lists.01.org
Cc: Wang Fan <fan.wang@intel.com>, Fu Siyuan <siyuan.fu@intel.com>,
Ye Ting <ting.ye@intel.com>, Jiaxin Wu <jiaxin.wu@intel.com>
Subject: [Patch 3/3] MdeModulePkg/DxeNetLib: Fix an error in packet length counting.
Date: Wed, 3 Jan 2018 10:31:51 +0800 [thread overview]
Message-ID: <1514946711-4056-4-git-send-email-fan.wang@intel.com> (raw)
In-Reply-To: <1514946711-4056-1-git-send-email-fan.wang@intel.com>
From: Wang Fan <fan.wang@intel.com>
* 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 <siyuan.fu@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wang Fan <fan.wang@intel.com>
---
MdeModulePkg/Library/DxeNetLib/DxeNetLib.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
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--;
Len += (UINT32) AsciiSPrint (
Buf + Len,
BufLen - Len,
"Tiano %a: %a (Line: %d File: %a)",
Module,
Message,
Line,
File
);
- Len--;
+ Len ++;
//
// OK, patch the IP length/checksum and UDP length fields.
//
Len += sizeof (EFI_UDP_HEADER);
--
1.9.5.msysgit.1
next prev parent reply other threads:[~2018-01-03 2:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-03 2:31 [Patch 0/3] Fix a set of issues for DxeNetLib fanwang2
2018-01-03 2:31 ` [Patch 1/3] MdeModulePkg/DxeNetLib: Fix a potential issue in macro definition fanwang2
2018-01-03 6:03 ` Wu, Jiaxin
2018-01-03 2:31 ` [Patch 2/3] MdeModulePkg/DxeNetLib: Add parameter check and ASSERT handling fanwang2
2018-01-03 6:03 ` Wu, Jiaxin
2018-01-03 2:31 ` fanwang2 [this message]
2018-01-03 6:03 ` [Patch 3/3] MdeModulePkg/DxeNetLib: Fix an error in packet length counting Wu, Jiaxin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1514946711-4056-4-git-send-email-fan.wang@intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox