diff options
author | Wang Fan <fan.wang@intel.com> | 2018-01-03 10:24:53 +0800 |
---|---|---|
committer | Fu Siyuan <siyuan.fu@intel.com> | 2018-01-04 10:56:13 +0800 |
commit | e4a45bb8b2cdb3539545be145585c945e6126b14 (patch) | |
tree | 0f202914cd7871c621764adfe66d243c5886381c | |
parent | 667fdaaac86b1247ab1f558127e2450effcf46c6 (diff) | |
download | edk2-e4a45bb8b2cdb3539545be145585c945e6126b14.tar.gz edk2-e4a45bb8b2cdb3539545be145585c945e6126b14.tar.bz2 edk2-e4a45bb8b2cdb3539545be145585c945e6126b14.zip |
MdeModulePkg/DxeNetLib: Fix an error in packet length counting.
* 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>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
-rw-r--r-- | MdeModulePkg/Library/DxeNetLib/DxeNetLib.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c index 90f17b71b5..cbce28f1ba 100644 --- a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c +++ b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c @@ -403,7 +403,6 @@ SyslogBuildPacket ( Time.Minute,
Time.Second
);
- Len--;
Len += (UINT32) AsciiSPrint (
Buf + Len,
@@ -414,7 +413,7 @@ SyslogBuildPacket ( Line,
File
);
- Len--;
+ Len ++;
//
// OK, patch the IP length/checksum and UDP length fields.
|