summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWang Fan <fan.wang@intel.com>2018-01-03 10:24:53 +0800
committerFu Siyuan <siyuan.fu@intel.com>2018-01-04 10:55:15 +0800
commitc5fcec8c3fe2fa82065aace4d20c6bc30a0f5783 (patch)
tree5dfeedd36453f2261ef51cff55c7f84979e7739f
parentcf4a8fa455c63feaffdb0fbc5b7c72729ffbb17f (diff)
downloadedk2-c5fcec8c3fe2fa82065aace4d20c6bc30a0f5783.zip
edk2-c5fcec8c3fe2fa82065aace4d20c6bc30a0f5783.tar.gz
edk2-c5fcec8c3fe2fa82065aace4d20c6bc30a0f5783.tar.bz2
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.c3
1 files changed, 1 insertions, 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
@@ -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.