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>
This commit is contained in:
Wang Fan 2018-01-03 10:24:53 +08:00 committed by Fu Siyuan
parent cf4a8fa455
commit c5fcec8c3f
1 changed files with 1 additions and 2 deletions

View File

@ -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.